how to access has_one in view?

So, what is the problem you’re having with has_one? The relationships you’ve described are correct, so you can do car.picture.filename (assuming Picture has a filename field). You’ll have to post your error messages if we are to help you.


Why don’t you go ahead and post the code for the two models and the controller? Something is messed up in the relationship setup.

For the record, you only need to do:

 @carobj = Car.find(idpassed)

which should give you