Я создаю оборудование, и у меня есть два действия в контроллере оборудования: new
и create
.. и у меня есть два вида, новый и частичный.
У меня также есть четыре таблицы .. equipments
, equipment_types
, equipment_locations
и equipment_management_informations
..
Форма выглядит как ..
>= error_messages_for 'equipment'
%table.contentText{:style => "width: 100%"}
- if @types
%tr
%td Equipment Type
%td= collection_select 'equipment', 'equipment_type_id', @types, :id, :name, {}, :class => "dropdownSelect"
%tr
%td Location
%td= select 'equipment', 'equipment_location_id', @equipment_locations.collect { |e| ["#{e.name.capitalize!}", e.id]},{}, :class => "dropdownSelect"
%tr
%td Serial Number
%td= text_field 'equipment', 'serial_number', :class => 'textFields'
%tr
%td MAC Address
%td= text_field 'equipment', 'mac_address', :class => 'textFields'
%tr
%td IP Address
%td= text_field 'equipment', 'ip_address', :class => 'textFields'
- if @stands
%tr
%td Stand
%td= collection_select 'equipment', 'stand_id', @stands, :id, :street_no, :include_blank => true
%tr
%td{:valign => 'top'} Description
%td= text_area 'equipment', 'description', :cols => 45, :rows => '3', :class => "txt_area_effect"
и мой новый взгляд выглядит так:
> %h3 New equipment
%div{:style => "border: 1px solid #CCC;"}
- form_tag :action => 'create', :estate_id => @estate do
= render :partial => 'form'
= submit_tag "Create"
- action = "list"
%input{:type => "button", :value => "Back", :onclick => "window.location='#{action}';", :class => "start"}
и мое действие создания показывает это ноль, когда я проверяю его
@equipment = Equipment.find(params[:equipment])
выдает ошибку типа
Unknown key(s): equipment_type_id, mac_address, description, equipment_location_id, serial_number, ip_address