When i create an Hash in a controller how i can know is name in the view? example_controller.rb ... def list @files = Hash.new end ... Now in list.rhtml using something like a specific rails var or function how i can get that there is an hash that is name is @files? thanks I hope my english is ok! -- 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 -~----------~----~----~----~------~----~------~--~---
David A. Black
2007-Feb-26 12:03 UTC
Re: how to get all the hashes and arrays passed from controller
Hi -- On 2/26/07, claudio <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > When i create an Hash in a controller how i can know is name in the > view? > > example_controller.rb > ... > def list > @files = Hash.new > end > ... > > Now in list.rhtml using something like a specific rails var or function > how i can get that there is an hash that is name is @files?The instance variable @files will be visible in the view. (Technically it''s a different instance variable @files, but the difference is transparent. It will be set to whatever you set it to in the controller.) David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.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 -~----------~----~----~----~------~----~------~--~---