<%= STATES[location.state.to_sym] %> ?
-
MaurĂcio Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Wed, Jan 21, 2009 at 4:06 PM, Sav
<savarino-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I inherited an app that created STATES & COUNTRIES as global hashes in
> config/environment.rb
>
> STATES = {}
> STATES[:AL] = ''Alabama''
> STATES[:AK] = ''Alaska''
> STATES[:AZ] = ''Arizona''
> ...
>
> I''m able to render the name correctly like this...
> <%= STATES[:AK] %>
>
> But what is the syntax to call that dynamically? This does not
> work...
> <%= STATES[location.state] %>
>
> Thanks, I''m stumped on this noob issue.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---