uninitialized constant Store rails routing error -
i have store controller , items controller, want each item appear under store/ store/items/id, routes file is;
match 'store'=> 'store#index' namespace :store resources :items, only: [:show] end when link item on store page correct url e.g 'store/items/1' when follow link error
actioncontroller::routingerror @ /store/items/1 uninitialized constant store
i don't know why i'm getting error...
namespace rolls module, name prefix , path prefix.
but in case, don't have module named store. controller instead. is, looking store::itemscontroller.
use instead:
scope '/store' resources :items, only: [:show] end this give path such item_path , uri /store/items/1
Comments
Post a Comment