Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Attribute < ApplicationRecord
- validates :name, presence: true
- validates :name, uniqueness: true
- has_many :attribute_vals
- end
- <div id="attributes_list">
- <%= @attributes.each do |attr| %>
- <% attr.attribute_vals.each do |val| %>
- - <%= val.name %>
- <% end %>
- <% end %>
- </div>
Add Comment
Please, Sign In to add comment