Hmm.. I'm in your same situation.
In your code:
<% if can? :create, @user %>
I believe that @user is nil, so when your Ability.rb try's to
read :account_id, it returns nil, and it is never == user.account_id,
thus your link is not displayed.
I don't know if it's the correcto solution, but I'm addi
I wish there were some DSL for this.
I'd like to, for example, use this in my view:
if can? :create, User :on => @account
But I think the example I gave you previously achieves the same
functionality.
On Dec 2, 1:35 pm, "Leonel *.*" wrote:
> >> According to the wiki..
> >>https://github.com/rya
Awesome! Thanks, I hadn't read that info. Works great :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe fr
On Thu, Dec 2, 2010 at 10:38 AM, Joshua Martin wrote:
> According to the wiki..
> https://github.com/ryanb/cancan/wiki/Checking-Abilities
>
> I think you may need to change the object that can? is evaluating from the
> @user variable to the class User like so:
>
> <% if can? :create, User %>
>
Th
According to the wiki..
https://github.com/ryanb/cancan/wiki/Checking-Abilities
I think you may need to change the object that can? is evaluating from the
@user variable to the class User like so:
<% if can? :create, User %>
<%= link_to 'New User',
new_user_path
%>
<% end %>
On Thu, Dec 2, 20
Nothing, the New User link it's just not displaying
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from th
6 matches
Mail list logo