Note that there are some explanatory texts on larger screens.

plurals
  1. PONot saving, no error message
    text
    copied!<p>On form submission, it's telling me that it was successfully created but it's not showing any data that was submitted. The database is empty. It's showing "null" values and the same on the actual screen where I should be able to edit the data. Here's a screenshot</p> <p><img src="https://i.stack.imgur.com/9i8Zr.png" alt="enter image description here"></p> <p>Update: I think the problem is that it's making a GET request but I don't know how to fix it. Here's a screen shot of my server doing a get when I clicked the submit <img src="https://i.stack.imgur.com/YdQam.png" alt="server doing a get"></p> <hr> <p><strong>Here's the set up</strong></p> <p>In the index action of results_controller.rb, I have</p> <pre><code> def index @results = Result.all @blob = Sex.new //==@blob = Sex.new is the one I'm focussing on... respond_to do |format| format.html # index.html.erb format.xml { render :xml =&gt; @results } end end </code></pre> <p><strong>In views/results/index, I have the form</strong></p> <pre><code>&lt;`%= form_for(@blob) do |f| %&gt;` &lt;div class="field"&gt; &lt;b&gt;1. solicitor exam was fixed?:&lt;/b&gt;&lt;br/&gt; &lt;%= f.label(:solicitorcurve, "it was cooked") %&gt; &lt;%= f.radio_button(:solicitorcurve, "t") %&gt; &lt;/br&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label(:solicitorcurve, "no it was ok") %&gt; &lt;%= f.radio_button(:solicitorcurve, "f") %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label(:draftingteach, "i give the teaching a grade of _ on a scale of 1 to 6") %&gt; &lt;%= f.select:draftingteach, 1..6 %&gt; &lt;/br&gt; &lt;/div&gt; </code></pre> <p><strong>In the create action of sexes_controller.rb i have</strong> </p> <pre><code>def create @sex = Sex.new(params[:blob]) respond_to do |format| if @sex.save format.html { redirect_to(@sex, :notice =&gt; 'Sex was successfully created.') } format.xml { render :xml =&gt; @sex, :status =&gt; :created, :location =&gt; @sex } else format.html { render :action =&gt; "new" } format.xml { render :xml =&gt; @sex.errors, :status =&gt; :unprocessable_entity } end end end </code></pre> <p>In models/sex.rb, there is nothing...</p> <pre><code>class Sex &lt; ActiveRecord::Base end </code></pre> <p><strong>And this is the set up of the database</strong></p> <p><img src="https://i.stack.imgur.com/IJXhN.png" alt="and this is my database structure"></p>
 

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