My Task - submit a form to some manual function 'place_order' inside 'Checkout' controller This is how i wrote form in my view file i.e
**<%= form_for (@order), url: {action: "place_order"} do |f| %>**
- It does reach inside this method and as i save object i want to redirect to some other method in the same class. This method name is 'thank_you'. My code looks like this inside 'place_order' method
** if @order.save redirect_to :action => 'thank_you' else end **
But it redirects to show method of this class. If I change redirect to other class, it redirects fine but on other method of same class, it always redirects to show.
-
Here is how i defined my routes
** resources :checkout resources :photos devise_for :users resources :carts
post 'checkout/place_order' match 'checkout/thank_you', to: 'checkout#thank_you', via: [:get] **
I need some expert opinion on this. Please help.
