Note that there are some explanatory texts on larger screens.

plurals
  1. POForm_for generates resource path ending with '.1'
    text
    copied!<p>I have a resource called :school and when I call form_for(@school) it generates the form action:</p> <p>/school.1</p> <p>I'm new to all this so any clues as to why it's doing that would be much appreciated. Sleep deprived and heading for a deadline in 3 hours, arrrggg!</p> <p>Thanks :)</p> <p>routes.rb:</p> <pre><code>resource:school </code></pre> <p>school.rb:</p> <pre><code>&lt;%= form_for(@school, :url =&gt; school_path) do |f| %&gt; &lt;% if @school.errors.any? %&gt; &lt;div id="error_explanation"&gt; &lt;h2&gt;&lt;%= pluralize(@school.errors.count, "error") %&gt; prohibited this school from being saved:&lt;/h2&gt; &lt;ul&gt; &lt;% @school.errors.full_messages.each do |msg| %&gt; &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt; &lt;% end %&gt; &lt;/ul&gt; &lt;/div&gt; &lt;% end %&gt; &lt;div class="field"&gt; &lt;%= f.label :name %&gt;&lt;br /&gt; &lt;%= f.text_field :name %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :address1 %&gt;&lt;br /&gt; &lt;%= f.text_field :address1 %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :address2 %&gt;&lt;br /&gt; &lt;%= f.text_field :address2 %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :address3 %&gt;&lt;br /&gt; &lt;%= f.text_field :address3 %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :town %&gt;&lt;br /&gt; &lt;%= f.text_field :town %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :county %&gt;&lt;br /&gt; &lt;%= f.text_field :county %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :postcode %&gt;&lt;br /&gt; &lt;%= f.text_field :postcode %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :local_authority_id %&gt;&lt;br /&gt; &lt;%= f.collection_select :local_authority_id, LocalAuthority.all, :id, :name %&gt; &lt;/div&gt; &lt;% if current_user.person.primary_user? %&gt; &lt;div class="field"&gt; &lt;%= f.label 'Are you happy for us to send you regular updates about VRH?' %&gt;&lt;br /&gt; &lt;%= f.check_box :allow_contact %&gt; &lt;/div&gt; &lt;% end %&gt; &lt;div class="actions"&gt; &lt;%= f.submit %&gt; &lt;/div&gt; &lt;% end %&gt; </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