Displaying 3 results from an estimated 3 matches for "logicstr".
Did you mean:
logics
2006 Jul 14
1
role-based conditionals
in the Rails Recipes book there is a chapter on role-based
authentication. it basically set up priviliges based on what page the
user was able to access. i went through the chapter and felt like i got
a pretty good understanding of how to do it.
now i am needing something a little more advanced though. instead of a
per page (or action) i would like to have certain sections on a page
either
2007 Oct 18
0
ACL System restrict_to
...tried it in the controller and i get the "undefined local variable
or method `restrict_to'' for Admin::SurveysController:Class" Ive even
copied the code from the access_control.rb in the plugin to the
application_helper but it still keeps giving the same error.
def restrict_to(logicstring, context = {})
return false if current_user.nil?
result = ''''
if permit?(logicstring, context)
result = yield if block_given?
end
result
end
?????
JB
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~---...
2007 Aug 11
2
Rspec and acl_system2 plugin
...:in
`render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:260:in
`render_file''
In the acl_system2 plugin, we have the following code :
# restrict_to "admin | moderator" do
# link_to "foo"
# end
def restrict_to(logicstring, context = {})
return false if current_user.nil?
result = ''''
if permit?(logicstring, context)
result = yield if block_given?
end
result
end
I''m just starting with rspec and I believe I''m missing something ...
Did someone run into this er...