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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:03:52+00:00 2026-06-13T00:03:52+00:00

I have a very weird behavior by Rails 3.2. I use a form_tag in

  • 0

I have a very weird behavior by Rails 3.2.

I use a form_tag in my haml page:

= form_tag messages_path, :method => :get do

this form contains some checkboxes
and this code works fine.

But I don’t like get.

If I substitute “get” with “post” something really weird happens:

It appears that the control goes to my “create” method, creates a nil object in my db and then goes back to the original page (that’s what I told the “create” method to do anyways).

Then, the checkboxes are pretty messed up…

Note: I save the checkbox contents in the session. Dunno, if it really matters.

Seems like “post” takes you to “create” by default ?? Can I change that ?
“Get” works fine but messes up my url….

any suggestions ???

  • 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-13T00:03:54+00:00Added an answer on June 13, 2026 at 12:03 am

    Yes by default post maps the request to the create method of the controller.

    If you want use post request add the below piece of code in config/routes.rb

    resources :messages do
      collection do
        post 'stuff'
      end
    end
    

    In your messages controller

    def stuff
      #your stuff goes here
    end
    

    Then the form builder will be

    form_tag stuff_messages_path, :method => :post
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very weird thing to do and simply don't know how. This
So, I have this very weird error - Some advanced PHP devs might also
This is very weird. I have the following code: Assert.AreEqual(new DateTime(2000, 1, 1), DateTime.ParseExact(2000,
Alright, I have some weird behavior and this question goes to the people out
I am facing a strange behavior by CakePHP 2.1: I have a method, $this->Time->getTime();
I have a very weird problem that I can't understand. This is C code:
I have a very weird problem. This ONLY affects Firefox on Mac, using the
I have encountered a very weird behavior while using SimpleDateFormat for parsing a string
I have been witnessing this weird behavior since last night. Here's the fiddle: http://jsfiddle.net/Gqndm/
I'm maintaining a web page and need to fix a very weird behavior under

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.