Hi,
I have created a plugin that has the following code in the init.rb
ActionController::Base.send :include, PersonaliseSite
The PersonaliseSite module has a class which_country that returns
''uk''
as a string.
Which means I can sucessfully do somthing like this in my users
controller
#
# render new.rhtml
def new
@user = User.new
@user.country = which_country
end
However whenever I pass which_country into the following line of code
record_select :per_page => 10,
:search_on => ''full_name'',
:order_by => "field(country, #{which_country})"
I get a undefined local variable or method `which_country'' for
UsersController:Class error.
Has anyone any suggestions on what is going on and why it can access the
value within a method but not within the above code
thanks
scott
--
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
-~----------~----~----~----~------~----~------~--~---