Ruby on Rails Sunday, February 2, 2014

On 2 February 2014 13:57, Frederick Cheung <frederick.cheung@gmail.com> wrote:
> ...
> You could update params in place , ie params.merge!(...).

Would that not use the value from defaults if it was already present in params?

>
> Personally I wouldn't do this. I'd be more likely to have a controller method called something like get_date_range that would get the dates from params that would do things like parse the strings into actual dates and/or replace missing params with defaults.

+1

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtrTpirQ8uOcMZLPEvajeAk9cOs-JanZp%3D7EMOjq_qGjA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment