I am using the following code for the select menu in my rails application
Controller:
@discount_options = {'% Off' => 'percent', '$ Off' => 'dollar', '$ For' => 'flat', 'Free with Purchase Of' => 'bonus', 'Buy One Get One Free' => 'bogo' }
View (inside form_for)
<%= f.select :discount, options_for_select(@frugle_discount_options) %>
This works great when creating a new record. If I go back to edit this entry, it always ends with the default "% Off"
I find it surprisingly difficult to find good documentation online about menu selection .. can someone help me?
Thanks!
source share