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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:55:18+00:00 2026-06-10T17:55:18+00:00

I have a nested polymorphic resource, question, which may be nested beneath an exam.

  • 0

I have a nested polymorphic resource, question, which may be nested beneath an exam. In the UI I build a form dynamically, using POST as the submit method. This works fine for the new action, POSTing to /exams/1/questions.

The issue is that for the edit action I get a Routing error (No route matched [POST]). I have checked the routes and can see that this is a valid error- there is a route for PUT which is connected to the update method.

My question is why does the edit action of a scaffolded model which uses POST as the form’s method work correctly, while my form submission generates the routing error above.

Here are the routes from my routes.rb:

  resources :exams do
    resources :questions
  end

Here is the dynamically generated form

<form method="POST" action="/exams/1/questions/9">
    <input name="authenticity_token" type="hidden" value="XXYYZZ=">
    <input name="[question]template" value="Image Answers"><input name="[question]text" value="Which of these is a duck?">
</form>

I am aware that I can add post :create to the members of questions to map this manually, but I’d like to know why this doesn’t work out of the box.

  • 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-10T17:55:20+00:00Added an answer on June 10, 2026 at 5:55 pm

    A quick test application, shows that a standard form_for includes a method field where the put is specified. Adding this field to my dynamically generated form solved the issue.

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

Sidebar

Related Questions

I have a number of tables, which have nested tables. I using jQuery to
I am using polymorphic association. I have 2 models articles and events which have
I have a polymorphic model and want to have a nested form use this
I have nested list of the following form: my_list = [['Some1', '2', '3.6', '4.5',
I'm using colorbox on a div. I have nested div's. When i click the
I'm working on a navigation control. I have nested lists which creates this: What
I have a nested drag and drop list which return json formattet string. I
I have nested groupboxes, which logically represent nested data structures in my application. Let's
great community :) I have category list which have nested child category list, which
I am using Twitter Bootstrap and at one place I have nested fluid-grid in

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.