Hello I have the following in a partial.
<% if can? :update, @permission %>
Yes
<% end %>
For the exact same user, when this loads via html this works great. But when I render that partial via ajax, as so:
$('#current').html('<%=escape_javascript(render :partial =>"permissions/teammembers", :locals => {:teammembers => @teammembers}) %>');
Then cancan is return false, why is that? the current_user is开发者_JAVA百科 the same person making the request?
Thanks
Check if @permission is not nil. Throw it and see if it is ok.
精彩评论