small medium large xlarge

Generic-user-small
07 Oct 2014, 09:49
Chris (2 posts)

I am confused as to why the routing for line_items_path creates a post method as in my routes, the line_items_path is not a named route, so how can I reference it with the path helper?

The code works, I just do not understand why, as my line_items_path also points to the line_items#index?

line_items_path GET /line_items(.:format) line_items#index POST /line_items(.:format) line_items#create

My routes file is as follows ~~~ Rails.application.routes.draw do resources :line_items resources :carts get ‘store/index’ resources :products

root ‘store#index’, as: ‘store’ ~~~

You must be logged in to comment