Home > Net >  How to hidden subdirectory in Rails
How to hidden subdirectory in Rails

Time:12-31

I wanna pass to a resource in a request for example

# Go to payment link
<%= link_to 'Payment', checkout_path(pricing: amount.id) %>

When I go to payment link the url path is the next:

  http://localhost:3000/checkout?pricing=amount_2aHUHuhdn23jnSJd

I'd like to hidden the subdirectory "pricing=amount_2aHUHuhdn23jnSJd" without have to used any gem

I'd appreciate your time and your grain of sand

CodePudding user response:

You can change the checkout API from GET to POST method.

CodePudding user response:

I'm not quite sure what you mean without seeing your routes.rb file. As mentioned by @Deepak Kumar to hide query from your url you should use POST request. Have a look at this guide. You can add below

post 'payment', to: 'checkout#payment'

In your routes.rb. This will call Payment action from your CheckoutsController

  • Related