Report abuse

sub model, position


			
class Position < ActiveRecord::Base
  belongs_to :account
  has_many :users
  has_many :position_auto_enrollments

  validates_uniqueness_of :name, :scope => :account_id

  def name
    self[:name].capitalize
  end
end

snippet from the view that contains multiple models, @user is the super model of the form that contains the submodel position

<% fields_for "user[position]", @user.position do |position| %> <% end %>

			
<%= position.text_field 'name' %>