I used scaffold to build a table called “assets”. The files were created. The “rake db:create” worked fine. I added ” resources :assets” to my routes.rb file. I now get route errors. I ran “rake routes” and none of the routes for “assets” show up.
Is it bad to use a table name “assets”?
Or is something else wrong?
The asset pipeline uses /assets by default.
You can either change the default assets path by using this in
application.rb:config.assets.prefix = '/something-else'Or change the routing for your assets resource by using:
resources :assets, :path => 'something-else'edit: Actually the second option is probably the better choice because I forgot that
asset_pathis available by default and belongs to the asset pipeline. If you changed your default assets prefix and usedasset_path @assethoping to generate a link toassets#showthen it might cause problems.Use the
:asoption in your routes to change the path/url methods it generates.resources :assets, :path => 'things', :as => 'things'things_pathresults in /things and routes to the index action of the assets controllerthing_path @assetresults in /things/:id and routes to the show action of the assets controlleretc.