routes
Nothing to display jet.
Nothing to display jet.
For example by namespace. Just create new folder for #routes config/routes/ and tell #rails to include it:
config.paths["config/routes"] += Dir[Rails.root.join("config/routes/*.rb")]
Then you can create files like this:
# config/routes/admin.rb
Pilot::Application.routes.draw do
namespace :admin do
resources :posts
end
end
How do we usually check the routes in #rails application? We are accustomed to use rake routes command in terminal but there are actually couple tricks. More under the cut
If you have a plural model name you should add underscored name to uncountable array in inflections.rb for create right #routes.
# inflections.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable %w(news)
end
# routes.rb
resources :news
Now #rails won't singular model in members actions.
http://api.rubyonrails.org/classes/ActiveSupport/Inflector/Inflections.html