Displaying 2 results from an estimated 2 matches for "logged_us".
Did you mean:
logged_in
2010 Jan 27
1
around_filter and with_scope
i got two controller (with restful actions) where my code is quite
ugly and not very dry. every action looks quite like this:
if @logged_user.has_role?("admin")
User.find(params[:id)
else
@logged_user.group.user.find(params[:id])
this is a security check that enforce a simple spec: normal user
should read/write information only about their group''s users, but
"admin" users can read/write about all users...
2006 Mar 16
2
please help: "undefined method ''updated?''"
...ame, :device_id
[...]
end
I want to add a comment to an existing interface, so here''s the update method:
------------------- controllers/interfaces_controller.rb ---------------------
[...]
def update
@interface = Interface.find(params[:id])
unless @interface.device.is_writable(@logged_user)
flash[:error] = ''Keine Berechtigung!''
redirect_to :action => ''show'', :id => @interface.id
else
if params[:interface][:upstream] != "1"
params[:interface][:upstream] = ''''
end
if @interf...