> Also guessing that you probably need to have that hash available to both
> the edit and new pages so you will probably need to set @durations using
> a before_filter:
>
> before_filter load_durations, :only => [ :new, :edit ]
>
> private
> def load_durations
> @durations = { "30 minutes" => "30",
> "1 hour" => "60",
> "1 hour 30 minutes" => "90",
> "2 hours" => "120" }
> end
The above was very useful too, helped me adhere to the DRY principles. I
feel like a toddler, I used to just code with PHP whatever my
imagination demanded, now I have to stop every line of code to make sure
I'm doing everything correctly lol
Thanks
--
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 [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.