RailsCasts Pro episodes are now free!

Learn more or hide this

Ralph Smith's Profile

GitHub User: RSmithBothell

Comments by Ralph Smith


Did you ever get an answer to this? I have the same situation.


A starting question would be, where do I find good read for the kind of question I have here?

I'm using the 'through' approach but I'm stumbling over some basics.
The models are set up correctly, but in my show.html.erb
I want to check for the existence of the other object before I show a value from it.
I'm running into 'undefined method' when I
<% if product.category %> <-- error
<% product.category.each do |pc| ...

Do I need to add methods to my categorization model, or some assignments in my controller for one of the models?