Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3 Nester_Form Gem: How do I customize the template?
    primarykey
    data
    text
    <p>I am using the rails 3 gem <a href="https://github.com/ryanb/nested_form" rel="nofollow">nested_forms</a> and would like to change how the default blueprint for insertion is generated. I can not figure out how/where this code would comes from, and how/where I would add code to modify it.</p> <p>I am currently using a partial for my form: </p> <p>/app/views/units/_unit.html.haml</p> <pre><code>%tr %td=f.text_field :units %td=f.text_field :dispatched %td=f.text_field :onscene %td=f.text_area :actions </code></pre> <p>The code snippet that calls the partial:</p> <p>/app/vies/reports/_form.html.haml</p> <pre><code>... %table.units %th Unit %th Dispatched%th On Scene %th Actions =f.fields_for :units %p= f.link_to_add "Add a unit", :units ... </code></pre> <p>I have all of the core functionality working, except for the template. That is auto created at run time by the gem. This template results in very simple HTML markup being used for the template.</p> <p>Which is similar to the following:</p> <pre><code>&lt;div id="units_fields_blueprint" style="display:none"&gt; &lt;p class="fields"&gt; &lt;input id="report_units_attributes_new_units_unit" name="report[units_attributes][new_units][unit]" size="30" type="text"&gt; &lt;input id="report_units_attributes_new_units_dispatched_1i" name="report[units_attributes][new_units][dispatched(1i)]" type="hidden" value="2011"&gt; ... &lt;/p&gt; &lt;/div&gt; </code></pre> <p>I would like the blueprint to have the tabular format that is in the partial, I just don't know how to get there.</p> <p>Any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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