How to set route.rb for ONLY the controller and view object?

I have a controller called store_controller and views for the store. But there is no model in the store, but I want to use store_path in the code. How to add store_path file to route.rb?

+3
source share
2 answers

If you have only one store (without an identifier), you can only create one route (with a name storeso that you can use store_path):

map.resource :store, :only => [:show]

You can also create your own route:

map.store "/store", :controller => "store", :action => "show"
+5
source
0

Source: https://habr.com/ru/post/1729697/


All Articles