ok this gets all records from the table where the id = tag how do i
change this for it to compare the “tag” with a other column apart from
the id?? sorry for being such a noob but thats what i am
On 9/9/06, Ben W. [email protected] wrote:
ok this gets all records from the table where the id = tag how do i
change this for it to compare the “tag” with a other column apart from
the id?? sorry for being such a noob but thats what i am
Table.find(:all, :conditions => [“other_column = ?”, params[:tag]) #
or :first, instead of :all
Don’t use @params anymore, BTW. And although it’s allowed, I think
the symbol as a key to the params hash (params[:tag]) is generally
favored over using a string (params[“tag”]).
thanks for the help
On 9/9/06, Ben W. [email protected] wrote:
thanks for the help
You’re welcome. I just noticed I’m missing a “]” in my original post,
by the way.
Table.find(:all, :conditions =>
[“other_column = ?”, params[:tag]]
)