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

  • Home
  • SEARCH
  • 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 8391339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:14:04+00:00 2026-06-09T19:14:04+00:00

I’m getting a routing error: No route matches [POST] /students/1 that I can’t figure

  • 0

I’m getting a routing error: No route matches [POST] “/students/1” that I can’t figure out. Here are the details.

view code:

<% @students.each do |student| %>
.
.
    <td><%= link_to 'Show', student %></td>
    <td><%= link_to 'Edit', edit_student_path(student) %></td>
    <td><%= link_to 'Select Subjects', select_path(student) %></td>  # error occurs here

In my students controller:

def select
  .
  .
end

routes.rb:
HomeSchool::Application.routes.draw do

  resources :notes

  resources :assignments

  resources :subjects do
    resources :assignments, :only => [:create, :index, :new]
  end

  resources :students

  resources :resources

  match "students/:id/select" => "students#select", :as => :select

  root :to => 'students#index'

end

The output from rake routes is:

                       GET    /students/:id/select(.:format)                  students/:id#select
                 notes GET    /notes(.:format)                                notes#index
                       POST   /notes(.:format)                                notes#create
              new_note GET    /notes/new(.:format)                            notes#new
             edit_note GET    /notes/:id/edit(.:format)                       notes#edit
                  note GET    /notes/:id(.:format)                            notes#show
                       PUT    /notes/:id(.:format)                            notes#update
                       DELETE /notes/:id(.:format)                            notes#destroy
           assignments GET    /assignments(.:format)                          assignments#index
                       POST   /assignments(.:format)                          assignments#create
        new_assignment GET    /assignments/new(.:format)                      assignments#new
       edit_assignment GET    /assignments/:id/edit(.:format)                 assignments#edit
            assignment GET    /assignments/:id(.:format)                      assignments#show
                       PUT    /assignments/:id(.:format)                      assignments#update
                       DELETE /assignments/:id(.:format)                      assignments#destroy
   subject_assignments GET    /subjects/:subject_id/assignments(.:format)     assignments#index
                       POST   /subjects/:subject_id/assignments(.:format)     assignments#create
new_subject_assignment GET    /subjects/:subject_id/assignments/new(.:format) assignments#new
              subjects GET    /subjects(.:format)                             subjects#index
                       POST   /subjects(.:format)                             subjects#create
           new_subject GET    /subjects/new(.:format)                         subjects#new
          edit_subject GET    /subjects/:id/edit(.:format)                    subjects#edit
               subject GET    /subjects/:id(.:format)                         subjects#show
                       PUT    /subjects/:id(.:format)                         subjects#update
                       DELETE /subjects/:id(.:format)                         subjects#destroy
              students GET    /students(.:format)                             students#index
                       POST   /students(.:format)                             students#create
           new_student GET    /students/new(.:format)                         students#new
          edit_student GET    /students/:id/edit(.:format)                    students#edit
               student GET    /students/:id(.:format)                         students#show
                       PUT    /students/:id(.:format)                         students#update
                       DELETE /students/:id(.:format)                         students#destroy
             resources GET    /resources(.:format)                            resources#index
                       POST   /resources(.:format)                            resources#create
          new_resource GET    /resources/new(.:format)                        resources#new
         edit_resource GET    /resources/:id/edit(.:format)                   resources#edit
              resource GET    /resources/:id(.:format)                        resources#show
                       PUT    /resources/:id(.:format)                        resources#update
                       DELETE /resources/:id(.:format)                        resources#destroy
                select        /students/:id/select(.:format)                  students#select
                  root        /                                               students#index

Any suggestions? I’m having a really hard time grasping exactly how routing in rails is supposed to work and I have yet to find any kind of treatise on it but I’m pretty sure that having no method listed for my select route is at least part of my problem.

Thanks,

Lon

  • 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-09T19:14:06+00:00Added an answer on June 9, 2026 at 7:14 pm

    Try removing the match in your routes.rb file and change your students resource to this:

    resources :students do
      member do
        get 'select'
      end
    end
    

    Also update your view to call select_student_path(student).

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.