I have the following code that works very well
@manufacturer = Manufacturer.find_manufacturer(params[:id])
which produces the following SQL:
SELECT * FROM `manufacturers` WHERE (`manufacturers`.`id` = 4) #Here
params[:id] =4
ON my view I can access the fields using
@manufacturer.field_name
However when I do the following
@manufacturer = Manufacturer.find(:all, :conditions => {:id =>
params[:id]})
Which produces the same SQL as above:
SELECT * FROM `manufacturers` WHERE (`manufacturers`.`id` = 4) #Here
params[:id] =4
I get the following error on my view:
NoMethodError in Public_manufacturers#show_manufacturer_details
Showing
app/views/public_manufacturers/show_manufacturer_details.html.erb where
line #4 raised:
undefined method `logo' for #<Array:0x26e4838>
Why is this happening and how can I solve it?
Thank you in advance.
--
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 [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
-~----------~----~----~----~------~----~------~--~---