Guest User

Untitled

a guest
Jun 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ## NameError in Features#show
  2.  
  3. Showing app/views/featureeditors/_featureeditor.html.erb where line #8 raised:
  4.  
  5. uninitialized constant Featureeditor::Editor
  6.  
  7. Extracted source (around line #8):
  8.  
  9. 5: -%>
  10. 6: <tr>
  11. 7: <td><%= featureeditor.date %></td>
  12. 8: <td><%= featureeditor.editor.name %></td>
  13. 9: </tr>
  14.  
  15. ## User model
  16.  
  17. class User < ActiveRecord::Base
  18. ..
  19. end
  20.  
  21. ## Editor Model
  22.  
  23. class Editor < User
  24. has_many :featureeditors
  25. has_many :features, :through => :featureeditors
  26.  
  27. validates_presence_of :name
  28. end
  29.  
  30. ## FeatureEditor Model
  31.  
  32. class FeatureEditor < ActiveRecord::Base
  33. belongs_to :feature
  34. belongs_to :editor
  35. end
  36.  
  37.  
  38. ## Feature model
  39. has_many :feature_editors
  40. has_many :editors, :through => :feature_editors, :source => :users
Add Comment
Please, Sign In to add comment