Hello, I am confused about the scope of the instance method
"authenticated?" in the class shown below (it''s defined in
the
application controller). It does not seem to be available in the block
initialising my active scaffold but it is available inside the method
"foo".
How can I gain access to the method in the initialisation block?
Many thanks!
class ItemController < ApplicationController
active_scaffold :item do |config|
columns[:category].ui_type = :select
if authenticated?
p "authenticated"
config.label = "Manage Items"
else
p "not authenticated"
config.label = "Search"
config.list.columns = [ :description, :address_posttown ]
columns[:address_posttown].label = "Town"
end
end
before_filter :foo
def foo
if authenticated?
p "authenticated"
else
p "not authenticated"
end
end
end
--
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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---