Thanks for your answer. I tried already: :params[:continent_id] //Error: Couldn't find Continent with ID=0
the problem is that :continent_id is the foreign key in products and i'm looking for the :id in continents which is the same then :continent_id I also tried to use: -:params[:continent_id].to_i //which comes out the same like :params[:continent_id] -:continent_id.to_i //Error: Couldn't find Continent with ID=103233 -:first, :conditions => [ "id = ?",:continend_id.to_i ]) //the same then above except that it don't brings the error because it just doesn't find ID=103233 and returns nil The problem with :continent_id.to_i is that it is not casting the number value which should put in the case above 7 out. - @product.continent = Continent.find(:first, :conditions => [ "id = ?",:continend_id ]) //returns nil the SQL looks like this SELECT * FROM "continents" WHERE (id = '--- :continend_id') LIMIT 1 -- 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.

