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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:34:21+00:00 2026-06-03T05:34:21+00:00

New to Rails, and following a tutorial that starts by creating the classic blog

  • 0

New to Rails, and following a tutorial that starts by creating the classic blog application.

Running: Rails 3.2.3 and Ruby 1.9.2

Started by creating a new Rails project, then generating scaffolding to create an Entry controller and views. Then used rake db:migrate to create the entries table on a mysql database server.

Started the Rails server (WEBrick 1.3.1), and pointed my browser to 0.0.0.0:3000/entries and it works fine, going to the index action by default.

But I was surprised to see that trying to point my browser to /entries/index returned an error. My entries controller includes the following actions: index, show, new, edit, create, update, destroy. Of these, only going to /entries/new actually works, the rest seem to be over-ridden by the :id default.

routes.rb contains two lines:

Mydiary::Application.routes.draw do

resources :entries

I thought the default format for accessing the actions of a controller was http://[hostname]/%5Bcontroller%5D/%5Baction%5D. So while it makes sense that not giving an action defaults to index, it frankly blew my mind that http://[hostname]/entries/index wouldn’t work. What possible reason could there be for this? Checking the rest it looks like only the new action works. All the rest are overridden by :id.

This doesn’t fit with what it says in the tutorial, by the way, which tells me this is new in Rails 3.

So I guess my question is, where can I find which actions are over-ridden by the :id action by default, and which aren’t? Very frustrating…

  • 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-03T05:34:23+00:00Added an answer on June 3, 2026 at 5:34 am

    run rake routes and you’ll see output that looks something like this:

    entries     GET      /entries(.:format)           entries#index
                POST     /entries(.:format)           entries#create
    new_entry   GET      /entries/new(.:format)       entries#new
    edit_entry  GET      /entries/:id/edit(.:format)  entries#edit
    entry       GET      /entries/:id(.:format)       entries#show
                PUT      /entries/:id(.:format)       entries#update
                DELETE   /entries/:id(.:format)       entries#destroy
    

    Basically, this results in:

    • Get a listing of entries, do GET /entries.
    • Post the data from a form to create a new record, POST /entries
    • Get a form to create a new entry, do GET /entries/new
    • Edit a specific entry, GET /entries/:id/edit
    • Show the details of a specific record, GET /entries/:id
    • Update the values for a specific entry, PUT /entries/:id
    • Delete/Destroy a specific record, DELETE /entries/:id

    A great place to start learning all this is the Rails Guide – Rails Routing from the Outside In.

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

Sidebar

Related Questions

New to Ruby on Rails and having a problem when following Michael Hartl's tutorial.I'm
I am new to Ruby on Rails and am following a tutorial to create
I am following this routing tutorial for Ruby on Rails: http://guides.rubyonrails.org/routing.html It says that
I'm new to creating a rails application. I'm going through this tutorial , and
I'm new to Rails and was following Ryan Bate's tutorial on how to make
I'm new to Rails, and am following the getting started guide on their website.
I've just started a brand new rails project and the first task I'm trying
I recently set up a new account with github. I'm following a Rails tutorial
I'm creating a fast application with ruby on rails, and after doing a lot
I'm following a tutorial http://fuelyourcoding.com/getting-started-with-jquery-mobile-rails-3/ transforming the views in a straightforward scaffolded Rails 3

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.