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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:57:49+00:00 2026-05-16T11:57:49+00:00

Take the most simple example: map.resource:account 1) How different is it from defining all

  • 0

Take the most simple example:

map.resource:account

1) How different is it from defining all the names routes – like:

:map.new_account “new_account”, :controller=>”activity”, :action=>”new”

2) How do you set an additional route within the resource definition? For example, say there is one more method for the resource

:map.brand_new_action “brand_new_action”, :controller=>”activity”, :action=>”brand_new_action”

Do we just add it below? But that seems to defeat the point of the resource

  • 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-05-16T11:57:50+00:00Added an answer on May 16, 2026 at 11:57 am

    How different is it from defining all the routes manually?

    It’s not different, in that it’s more of a convenience. Why would you want to define all your routes by hand, that can be quite tedious. So the common CRUD actions are mapped automatically, below is an example using a contacts controller:

    map.resources :contacts
    
    ... or in Rails 3 ...
    
    resources :contacts
    
    http_verb - action - route
    GET    - index   - /contacts
    GET    - show    - /contacts/5
    GET    - new     - /contacts/new
    POST   - create  - /contacts/create
    GET    - edit    - /contacts/5/edit
    PUT    - update  - /contacts/5
    DELETE - destroy - /contacts/5
    

    These are commonly referred to as the “7 Restful Actions,” however you can add your own custom routes if needed (although you’re strongly encouraged to use the 7 whenever possible).

    How do you add additional resources/routes?

    Adding additional routes is easy. First you want to decide if you’re working with a collection or a specific member, then also consider if the action is creating or updating something. For update actions you want to use PUT, create POST, destroying uses DELETE, and anything else is probably a GET.

    map.resources :contacts, :collection => { :new_this_month => :get },
                             :member => { :make_featured_person => :put }
    
    ... or in Rails 3 ...
    
    resources :contacts do
      collection do
        get 'new_this_month'
      end
    
      member do
        put 'make_featured_person'
      end
    end
    
    http_verb - action - route
    GET    - new_this_month        - /contacts/new_this_month
    PUT    - make_featured_person  - /contacts/5/make_featured_person
    

    Most of the time the 7 Restful Actions are plenty enough, but in some situations you’ll need custom routes. This is why Rails handles the most common case and gives you the ability to handle unique cases.

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

Sidebar

Ask A Question

Stats

  • Questions 505k
  • Answers 505k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your problem is caused by Zip decimal(5), as the ODBC… May 16, 2026 at 3:17 pm
  • Editorial Team
    Editorial Team added an answer You want to do bootstraping, using visual studio 2010 and… May 16, 2026 at 3:17 pm
  • Editorial Team
    Editorial Team added an answer You need Socket.shutdownOutput. Closing either the InputStream or the OutputStream… May 16, 2026 at 3:17 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Take my domain class for example public class Person { private Integer id; private
This seems a ridiculously simple question to be asking, but what's the shortest/most idiomatic
Randomized binary search trees like treap give a good performance (in the order of
So thanks to many of the replies from this board, I have a much
There is a container, for example lets say which has a volume of V.
I've checked most of the question that was display regarding my title but they
I have implemented the A* algorithm in AS3 and it works great except for
Using C# ASP.NET I want to program a queue. I want to have X
I'm trying to write a function that repeatedly matches regexp patterns against an input
Is it possible to reflectively instantiate a generic type in Java? Using the technique

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.