Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## error
- Showing app/views/tabs/index.rhtml where line #3 raised:
- You have a nil object when you didn't expect it!
- The error occurred while evaluating nil.name
- Extracted source (around line #3):
- 1: <% for tab in @tabs %>
- 2: <div>
- 3: <%= tab.artist.name %>
- 4: </div>
- 5: <% end %>
- ## tab.rb
- class Tab < ActiveRecord::Base
- has_one :artist,
- :foreign_key => 'artist_id'
- def self.find_all_tabs
- find(:all)
- end
- end
- ## artist.rb
- class Artist < ActiveRecord::Base
- belongs_to :tab,
- :foreign_key => 'artist_id',
- end
Add Comment
Please, Sign In to add comment