Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6892951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:35:54+00:00 2026-05-27T06:35:54+00:00

On form submission, it’s telling me that it was successfully created but it’s not

  • 0

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

enter image description here

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
server doing a get


Here’s the set up

In the index action of results_controller.rb, I have

    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 => @results }


    end
  end

In views/results/index, I have the form

<`%= form_for(@blob) do |f| %>`

<div class="field">
    <b>1. solicitor exam was fixed?:</b><br/>
    <%= f.label(:solicitorcurve, "it was cooked") %>
    <%= f.radio_button(:solicitorcurve, "t") %> </br>
  </div>  
  <div class="field">

   <%= f.label(:solicitorcurve, "no it was ok") %>
    <%= f.radio_button(:solicitorcurve, "f") %>
   </div>  

    <div class="field">
    <%= f.label(:draftingteach, "i give the teaching a grade of _ on a scale of 1 to 6") %>
    <%= f.select:draftingteach, 1..6 %> </br>
    </div>

In the create action of sexes_controller.rb i have

def create

    @sex = Sex.new(params[:blob])
    respond_to do |format|
      if @sex.save
        format.html { redirect_to(@sex, :notice => 'Sex was successfully created.') }
        format.xml  { render :xml => @sex, :status => :created, :location => @sex }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @sex.errors, :status => :unprocessable_entity }
      end
    end
  end

In models/sex.rb, there is nothing…

class Sex < ActiveRecord::Base
end

And this is the set up of the database

and this is my database structure

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:35:54+00:00Added an answer on May 27, 2026 at 6:35 am

    It looks like the issue is that you’re retrieving params[:blob] when you should be looking at params[:sex]. form_for will create fields named after the class of the object. The instance variable name @blob you’re using is arbitrary.

    ...
    @sex = Sex.new(params[:sex])
    ...
    

    This is a good argument for why you probably want to name instance variables for what they are. Less confusion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in order to make sure all form submission and all data submitted to server
I am trying to catch a form submission with jquery that is submitted via
On form submission does anything else get submitted but the value? Can I submit
If my POST data from a form submission = John Doe, and I'm trying
If I wanted to save a contact form submission to the database, how can
I have a simple form that I would like to validate on form submission.
I have a function that checks the age of a form submission and then
I have a form submission that is rendering a gsp template and inserting it
I have implemted AJAX form submission into my webforms before without issue but now
I have setup some automatic form submission code. Basically when a form is submitted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.