Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## NameError in Features#show
- Showing app/views/featureeditors/_featureeditor.html.erb where line #8 raised:
- uninitialized constant Featureeditor::Editor
- Extracted source (around line #8):
- 5: -%>
- 6: <tr>
- 7: <td><%= featureeditor.date %></td>
- 8: <td><%= featureeditor.editor.name %></td>
- 9: </tr>
- ## User model
- class User < ActiveRecord::Base
- ..
- end
- ## Editor Model
- class Editor < User
- has_many :featureeditors
- has_many :features, :through => :featureeditors
- validates_presence_of :name
- end
- ## FeatureEditor Model
- class FeatureEditor < ActiveRecord::Base
- belongs_to :feature
- belongs_to :editor
- end
- ## Feature model
- has_many :feature_editors
- has_many :editors, :through => :feature_editors, :source => :users
Add Comment
Please, Sign In to add comment