[Rails] How to use a parameter with a string?
softwareengineer 99
softwareengineer99 at yahoo.com
Thu Jan 26 00:41:01 GMT 2006
Hello,
I am learning Ruby on Rails and have a very basic question.
def self.home_categories (portal_id)
find(:all,
:conditions => "portal_id=:portal_id"
)
end
How can I put the value of portal_id in the string "portal_id=...". I tried concatenation but I get the error that it cannot convert.
I can figure it out eventually but thought someone may have the answer ready.
Thanks
Frank
---------------------------------
Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060126/d5dd6c86/attachment.html
More information about the Rails
mailing list