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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:29:07+00:00 2026-05-16T15:29:07+00:00

map.resource :basket, :collection => { :checkout => :post } The above does not work

  • 0
map.resource  :basket, :collection => { :checkout => :post }

The above does not work for a resource, as you would expect since basket is a resource (ie. singular) not resources, so there is no concept of a collection, everything should be scoped to the current_user. In this case User has_one Basket.

However I would like to specify a custom route without having to resort to adding another line in routes, eg:

map.checkout 'basket/checkout', :controller => 'baskets', :action => 'checkout'

Is this possible?

Of course my other option is to add a checkouts controller.

  • 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-16T15:29:07+00:00Added an answer on May 16, 2026 at 3:29 pm

    Just use :member option instead of :collection:

    map.resource :basket, :member => {:checkout => :post}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have map.resources :posts and I want to be able to serve post bodies
I have the following route map.resource :account, :controller => users map.resources :users and /account/new
I have a RESTful resource map.resources :books and I want to make the edit
I'm having trouble understanding how singular resource works in Rails. In particular, how does
In the rails 2 version of my app I have this resource defined map.resources
I have a nested resource in my routes.rb like this: map.resources :users, :only =>
So I created some rspec_scaffold for an Exercise model and added map.resource :exercises to
If you add a resource map to a namespace in your routes.rb in Rails
I have a Site Map link that opens up a Web Resource .htm page.
I got a resource called posts, now i want to map root to posts

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.