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 7768895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:02:22+00:00 2026-06-01T16:02:22+00:00

I have the following form: = form_for([current_user,@company], :remote => true) do |f| -if @company.errors.any?

  • 0

I have the following form:

= form_for([current_user,@company], :remote => true) do |f|
  -if @company.errors.any?
    #error_explanation
      %h2= "#{pluralize(@company.errors.count, "error")} prohibited this company from being saved:"
      %ul
        - @company.errors.full_messages.each do |msg|
          %li= msg
  =f.label :name
  =f.text_field :name
  =f.label :address
  =f.text_area :address, :rows => 3, :cols => 5
  =f.label :phone_number
  =f.text_field :phone_number
  .actions
    = f.submit 'Save'

When I click the save button I can see the folllowing in my server log:

Started POST "/users/1/companies" for 127.0.0.1 at 2012-04-04 21:27:50 +0700
Processing by CompaniesController#create as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"6ZH9hAUuf5ZTCf8Loc4M/IIl/Etzm7uDGoYbIgCTvhI=", "company"=>{"name"=>"test", "address"=>"test", "phone_number"=>"5454543"}, "commit"=>"Save", "user_id"=>"1"}
   (0.2ms)  BEGIN
  SQL (25.2ms)  INSERT INTO "companies" ("address", "name", "phone_number", "url", "user_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["address", "test"], ["name", "test"], ["phone_number", "5454543"], ["url", nil], ["user_id", nil]]
   (1.6ms)  COMMIT
  Rendered companies/create.js.erb (0.7ms)
Completed 200 OK in 41ms (Views: 8.1ms | ActiveRecord: 27.0ms)


Started POST "/users/1/companies" for 127.0.0.1 at 2012-04-04 21:27:50 +0700
Processing by CompaniesController#create as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"6ZH9hAUuf5ZTCf8Loc4M/IIl/Etzm7uDGoYbIgCTvhI=", "company"=>{"name"=>"test", "address"=>"test", "phone_number"=>"5454543"}, "commit"=>"Save", "user_id"=>"1"}
   (0.7ms)  BEGIN
  SQL (2.7ms)  INSERT INTO "companies" ("address", "name", "phone_number", "url", "user_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["address", "test"], ["name", "test"], ["phone_number", "5454543"], ["url", nil], ["user_id", nil]]
   (12.8ms)  COMMIT
  Rendered companies/create.js.erb (0.1ms)
Completed 200 OK in 30ms (Views: 10.5ms | ActiveRecord: 16.1ms)

Which means the form is being submitted twice.
I have removed the assets folder from my public directory. I have also checked the html rendered on the page and there is no double inclusion of jquery or other dependencies.

Why is it being submitted twice?

  • 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-06-01T16:02:24+00:00Added an answer on June 1, 2026 at 4:02 pm

    i had run rake assets:precompile and was running my server in development mode. solution was to rake assets:clean and restart the sever

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

Sidebar

Related Questions

I have done the following form <% form_for @anexo, :url => {:action => create},
i have the following if-clause: if(empty($var)){ $errors[]=Failure; } this is for a form that
For example Imagine I have the following form <%= form_for(@comment) do |f| %> <%=
Lets say I have a working form that looks like the following =form_for @survey
I'm using Rails 3.2.3 and I have the following form <%= form_for(@item, url: list_path,
I have the following form for photo_album which uses the nested forms feature of
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I have the following code in my view: <%= form_for :command_selected, :method => get,
We have the following code working for a complex rails form with checkboxes. I'm
I have the following form in a Struts2 JSP that contains some radio buttons.

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.