Hi, I have the following User model:
class User < ActiveRecord::Base
has_many :competences
has_many :skills, :through => :competences
accepts_nested_attributes_for :skills
end
and the following Skill model:
class Skill < ActiveRecord::Base
has_many :competences
has_many :users, :through => :competences
end
The Competence model has a 'type' attribute and it is the join model. Inside the nested form, How can I set the 'type' attribute while I save the submitted skills? Here is the nested form:
<% f.fields_for :skills do |s| %>
<%= s.text_field :name %>
<% end %>