Changing every route from /product to /eshop in Rails Route 3 -
in routes.rb have foll entries:-
resources :products 'get_products', :on => :collection 'show_product_details',:on=>:member 'buy_this',:on=>:collection 'search_product',:on=>:collection end
i want change every /products /eshop in url. not sure can use :path=>:eshop
.will applicable sub routes such eshop/get_products,eshop/buy_this
...etc.
you can modify routes , run rake routes in terminal check paths.
resources :products, :path => 'eshop', :as => 'eshop' 'get_products', :on => :collection 'show_product_details',:on=>:member 'buy_this',:on=>:collection 'search_product',:on=>:collection end
will produce these
get_products_eshop_index /eshop/get_products(.:format) products#get_products show_product_details_eshop /eshop/:id/show_product_details(.:format) products#show_product_details buy_this_eshop_index /eshop/buy_this(.:format) products#buy_this search_product_eshop_index /eshop/search_product(.:format) products#search_product eshop_index /eshop(.:format) products#index post /eshop(.:format) products#create new_eshop /eshop/new(.:format) products#new edit_eshop /eshop/:id/edit(.:format) products#edit eshop /eshop/:id(.:format) products#show put /eshop/:id(.:format) products#update delete /eshop/:id(.:format) products#destroy
Comments
Post a Comment