Not necessarily. The params object is just a hash. There is no reason
why you can't or shouldnt pass a configuration hash to a method. I do
something similar quite often. One instance I find myself working with
is XML API's that I must generate. Many options are available on the
query string. To handle this I use a pattern similar to the example
below:

#Controller
@models = Model.collection_for_api(params[:model])
render :xml => @models

#Model
def self.collection_for_api(opts = {})
  # assemble a bunch of named scopes based on opts
end

On Dec 5, 9:09 am, "blinking bear" <[EMAIL PROTECTED]> wrote:
> I want to pass the params collection from the controller to the model to
> parse filtering and sorting conditions.  Does having a method in the model
> that takes the params from the controller break MVC?
--~--~---------~--~----~------------~-------~--~----~
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