Mario Jauvin
2007-May-03 02:53 UTC
Using the ActionView::Helpers::FormTagHelper and ActionView::Helpers::FormOptionsHelper outside of a view
Hi, I have a utility class (in the lib/media_set/media.rb file in my ruby application) and in there, I would like to access the ActionView::Helpers::FormTagHelper.select_tag and ActionView::Helpers::FormOptionsHelper.options_for_select to create a select tag. However, in the view files, I can just refer to select_tag(...) or options_for_select(...) and obviously rails "know" that these are instance methods on some instance of the FormTagHelp and FormOptionsHelper classes. I have two questions: 1. how can I use the select_tag and options_for_select methods in my utility class? Can I use the same instance as would have been used in the view? 2. how does Rails make accessible or associate select_tag and options_for_select with an existing instance of these classes in the view file? Much appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---