On Sat, Feb 1, 2014 at 10:22 PM, Bizt <[email protected]> wrote:
> I've been trying to set default URL parameters in the controller, which will
> also be used within the view.

> ... so I was wondering what the best practise is for handling this.

Personally, I'd say "best practice" is "don't do that"  :-)

Instead of passing raw params to a view, build your model object
(or a service object) with them and pass that in. And if you need
defaults for missing attributes specified, the model/s.o. would be
a better place for them.

FWIW,
-- 
Hassan Schroeder ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA3wzegOGHJ8_bKchdpqVXEb6wCAkp9W382G%3DLb%2BmzCQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to