Guest User

Untitled

a guest
Jul 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #category.rb
  2. class Category
  3. has_many :resources
  4.  
  5. NAMES = self.all.map do |c|
  6. [c.name,c.id]
  7. end
  8. end
  9.  
  10. #resources/new.html.erb
  11. f.select(:category_id, Category::NAMES, {:include_blank => false})
Add Comment
Please, Sign In to add comment