javascript - assert_valid_keys in form view -


i'm brand new programming , newer ror. i'm having problem forms of 1 of pages. used javascript create drop down menu changes lower drop down menu (for example if choose state, drop down menu below display cities state instead of of cities on table it's linked to). drop-down menus sectors , subsectors. after doing that, error line of code made.

undefined method 'assert_valid_keys' :company:symbol 

i'm not sure trying tell me , after looking around on internet while no success decided ask here.

it says error occurs on line 30 (second line in excerpt). in form.html company table.

<%= f.label :subsector_id %><br /> <%= f.grouped_collection_select :subsector_id, sector.all, :subsectors, :sector_name, :id, :subsector_name %> 

these models tables.

class company < activerecord::base belongs_to :sector has_many :subsectors, through: :sectors attr_accessible :city, :company_name, :description, :employees, :sector_id, :subsector_attributes, :subsector_id end  class subsector < activerecord::base attr_accessible :sector_id, :subsector_name, :subsector_id belongs_to :sector, :company end  class sector < activerecord::base attr_accessible :sector_name has_many :companies has_many :subsectors end 

here controller subsectors.

class subsectorscontroller < applicationcontroller   def index     @subsectors = subsector.all     respond_to |format|       format.html       format.json { render json: @subsectors }     end end    def show     @subsector = subsector.find(params[:id])     respond_to |format|       format.html       format.json { render json: @subsector } end end    def new     @subsector = subsector.new     respond_to |format|       format.html       format.json { render json: @subsector } end  end    def edit     @subsector = subsector.find(params[:id])   end    def create     @subsector = subsector.new(params[:subsector])     respond_to |format|       if @subsector.save         format.html { redirect_to @subsector, notice: 'subsector created.' }         format.json { render json: @subsector, status: :created, location: @subsector }       else         format.html { render action: "new" }         format.json { render json: @subsector.errors, status: :unprocessable_entity } end  end end 

the same error occurs when try open subsectors page. i'm not sure need fix this.

if let me know should try figure 1 out. or give me general idea of why errors these come great!


Comments