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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:27:30+00:00 2026-06-17T08:27:30+00:00

In my rails app i have such route for carts controller: resources :carts so

  • 0

In my rails app i have such route for carts controller:

resources :carts

so in layout, according to my logic i have:

= link_to "Моя корзина", @cart

and in browser i see for example:

******:3000/carts/112

Could i however do nested rails route show as post-like request? so i will have:

******:3000/carts/

also rake routes:

arts GET    /carts(.:format)                                                          carts#index
                                  POST   /carts(.:format)                                                          carts#create
                         new_cart GET    /carts/new(.:format)                                                      carts#new
                        edit_cart GET    /carts/:id/edit(.:format)                                                 carts#edit
                             cart GET    /carts/:id(.:format)                                                      carts#show
                                  PUT    /carts/:id(.:format)                                                      carts#update
                                  DELETE /carts/:id(.:format)                                                      carts#destroy
                             cart POST   /carts/:id(.:format)                                                      carts#show

I now how to write it for my own methods… But how to be with build-in show?

i need to change show route, so that id for show is sending not as get-param by url, but as post-param in request…

  • 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-17T08:27:31+00:00Added an answer on June 17, 2026 at 8:27 am

    The resources method simply puts in a bunch of predefined routes, as described here.

    Specifically, it is adding the equivalent of

    get '/carts/:id' => 'carts_controller#show'
    post '/carts' => 'carts_controller#create'
    ...
    

    If you want to use a different set of routes, don’t use resources, and just define your own routes instead.

    Also, you can’t hide the cart id from the user this way. If the request contains the ID, it means that the user can see it. He might have to view it with Firebug or by looking at the page source instead of his address bar, but it’s still not secret or protected in any way.

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

Sidebar

Related Questions

I have a Rails app with the usual application_controller, and a controller (and model)
In my rails app i use active admin, now i have such model (only
I have a simple rails app using devise--as such (and being a new rails
In my rails app, i have a create button as such def create @client
I have a rails app, which is constructed by three parts such as navigation
I have a number of 'system' passwords in my Rails app, such as database
I have such code in routes.rb in Rails 3 app: scope 'robokassa' do match
I have a medium-complex Rails app. The main controller (the one that does what
In my rails app now i have such data: [[{:car=>, :article=>, :group=>, :price=>}, {:car=>Volkswagen,
I have a Rails controller named PagesController that is nested as follows in app/controllers/sevenpages/public/pages_controller.rb

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.