On Nov 5, 7:31 pm, James Byrne <[EMAIL PROTECTED]>
wrote:
> Should this instead be constructed so that the model, Locations, has
> these virtual attributes:
>
>     valid_location_type[]=
>       [
>         ['MAIN - Main Location','MAIN'],
>         ['POST - Postal Delivery', 'POST'],
>       ...
>       ]
>
>     default_location_type = 'MAIN'
>
Personally I would have it as a constant of the Location class, ie

class Location ...
  VALID_TYPES = [...]
end

Fred

> and then the view could have this instead:
>
>       <%= f.select  :location_type,
>                     @location.valid_location_type,
>                     :selected => @location.default_location_type,
>                     :size => 4
>
> Would this even work?
>
> Comments?
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to