Sorry for the simplicity on this. I hope this makes for a quick response.
I have two classes:
class UserProfile < ActiveRecord::Base
class UserGroup < ActiveRecord::Base
I want to display the UserGroup.Name for an UserProfile instance.
This snippet returns the correct User_Group id:
This code seemed the most logical to me:
but I get this error:
You have a nil object when you didn't expect it! The error occurred while evaluating nil.Name
What should the call be?
Thanks in advance!