Thx, helped alot,
now I just:
In my model
attr_accessor :can_edit,:can_read
In my controller i set the can_edit and simply
respond_with(@scripts,:methods => [:can_edit,:can_view])
there is allso a as_json method you can put into the model and it overrides
to_json
so you do not need to write ",:m
After some research i have added
attr_accessor :can_edit,:can_read
and now when I:
@scripts.each do |script|
script.can_edit=can?(:edit,script)
logger.debug("Script#{script.to_yaml}")
end
I do not get any warning, but in my log can_edit is not being printed,
allso if i json the result (@s
I'm using:
ruby 1.9.3p125 (2012-02-16 revision 34643)
rails 3.2.13
activesupport (3.2.11)
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-ta
Dana ponedjeljak, 15. travnja 2013. 09:18:18 UTC+2, korisnik Filip Matošić
napisao je:
>
> Developing an application with angular I came into a problem. In my
> application I use cancan ( https://github.com/ryanb/cancan ).
> Now when showing data in a table i have to filter if the logged user
Developing an application with angular I came into a problem. In my
application I use cancan ( https://github.com/ryanb/cancan ).
Now when showing data in a table i have to filter if the logged user can or
cannot edit, view etc, and thus disabling buttons that allow given
operations.
When using
I am a fairly new Rails developer, allso i begun to develop with angular as
it gives sense and clarity.
I have come up to a bit of a problem. I use CANCAN to manage user->role
wrights, but now it
gives me a very hard time to implement with angular in cases where i have a
repeater, as i need to
6 matches
Mail list logo