Note that there are some explanatory texts on larger screens.

plurals
  1. POI am having difficulties with creating an equipment
    text
    copied!<p>I am creating an equipment and I have two actions in my equipment controller, <code>new</code> and <code>create</code>.. and I have two views which is new and a partial form.. </p> <p>I also have four tables.. which are <code>equipments</code>, <code>equipment_types</code>, <code>equipment_locations</code>, and <code>equipment_management_informations</code>.. </p> <p>The form looks like..</p> <pre><code>&gt;= error_messages_for 'equipment' %table.contentText{:style =&gt; "width: 100%"} - if @types %tr %td Equipment Type %td= collection_select 'equipment', 'equipment_type_id', @types, :id, :name, {}, :class =&gt; "dropdownSelect" %tr %td Location %td= select 'equipment', 'equipment_location_id', @equipment_locations.collect { |e| ["#{e.name.capitalize!}", e.id]},{}, :class =&gt; "dropdownSelect" %tr %td Serial Number %td= text_field 'equipment', 'serial_number', :class =&gt; 'textFields' %tr %td MAC Address %td= text_field 'equipment', 'mac_address', :class =&gt; 'textFields' %tr %td IP Address %td= text_field 'equipment', 'ip_address', :class =&gt; 'textFields' - if @stands %tr %td Stand %td= collection_select 'equipment', 'stand_id', @stands, :id, :street_no, :include_blank =&gt; true %tr %td{:valign =&gt; 'top'} Description %td= text_area 'equipment', 'description', :cols =&gt; 45, :rows =&gt; '3', :class =&gt; "txt_area_effect" </code></pre> <p>and my new view is like:</p> <pre><code>&gt; %h3 New equipment %div{:style =&gt; "border: 1px solid #CCC;"} - form_tag :action =&gt; 'create', :estate_id =&gt; @estate do = render :partial =&gt; 'form' = submit_tag "Create" - action = "list" %input{:type =&gt; "button", :value =&gt; "Back", :onclick =&gt; "window.location='#{action}';", :class =&gt; "start"} </code></pre> <p>and my create action display this a nil when i inspect it</p> <pre><code> @equipment = Equipment.find(params[:equipment]) </code></pre> <p>it gives an error like</p> <pre><code> Unknown key(s): equipment_type_id, mac_address, description, equipment_location_id, serial_number, ip_address </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload