turkan wrote in post #964900:
>> You can DRY it by putting it in a method.
>
> In what method should I put it that is visible in all models? In an
> extra lib class?

Probably.

>
>>
>> I also have to wonder why a _model_ is worrying about page number and 
>> per_page.
>
> I pass it to a model method that does some Sphinx search. What would
> be a better way? The search expression is so long, so I thought it
> would be good to keep it out of my controller (everybody says "keep
> your controller thin").

Then you probably want a separate model to talk to Sphinx, then call 
Sphinx.search(params[:criteria]) in your controller.  Or maybe you want 
a utility class to do this.  It really depends on the structure of your 
app.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to