Note: remove the where in the string, I was typing a bit too quickly
and that does not belong.

I should have said my preferred practice as well. But glad everything
worked out.

On May 23, 5:06 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> Mike Rose wrote:
> >> @albums=Album.find(:all, :conditions => [:artist_id =>
> >> params[:find_id]])
>
> > Good practice for it to read like this
>
> > @albums = Album.find(:all, :conditions => "where artist_id = '#{params
> > [:find_id}'")
>
> Nope.  Your "good practice" is in fact more typing and more literal SQL
> for what as far as I can see is no good reason at all.  Take advantage
> of Rails' syntactic sugar and stick with the first version.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://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-talk@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