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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:15:34+00:00 2026-06-01T19:15:34+00:00

When generating a controller, rails automatically put ‘get controller/action’ at top of routes.rb file

  • 0

When generating a controller, rails automatically put ‘get controller/action’ at top of routes.rb file for each of the resourceful action (such as index, new, create, edit. etc.). What’s purpose of this ‘get’? Since there is a ‘resources’ for the same model in routes.rb, can we get rid of this ‘get’? Is the ‘get’ needed for ‘put’ custom action in routes.rb?

Thanks so much.

  • 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-01T19:15:35+00:00Added an answer on June 1, 2026 at 7:15 pm

    You can safely remove that route.

    The proper layout for basic resource routing in Rails 3.1 follows this format:

    resources :users do # Provides GET /users, /users/new, /users/:id, /users/:id/edit, POST /users, PUT /users/:id, DELETE /users/:id
      # Additional routes which return collections (not CRUD)
      collection do
        get :search # /users/search
      end
    
      # Additional routes which return single models (not CRUD)
      member do
        put :add_friend # /users/:id/add_friend
      end
    end
    

    You can read the full Rails routing guide here: http://guides.rubyonrails.org/routing.html

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

Sidebar

Related Questions

The following line in my news_lists_controller.rb file is generating an error: (1 .. @tot_actions).each
I am new Rspec and just started by generating a new controller on Rails
Currently, I have an action in my customers controller generating an array of names,
I am generating a url in my controller accessed from the relative path /hangouts/test,
Generating normal columnar data in excel file is quite easy but does any one
While generating charts using RS 2008 betas, RC0 and such., I never specified any
Im generating a file to present to the user for download, but the server
When generating models from postgresql with ColdFusion Illudium Code generator the boolean values get
My Rails app is generating this error whenever validation aren't met: undefined method `model_name'
I have a Rails app that is generating duplicate requests for every request 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.