Rails 3 routing: singular option
You used to be a开发者_JAVA百科ble to do:
resources :paises, :singular => :pais
But I tried this in Rails and it didn't work. I want to have 'pais_path()' for show and 'paises_path()' for index.
thanks
open your config/initializers/inflections.rb
file and add this
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'pais', 'paises'
end
then your route resources :paises
will work for you as expected
精彩评论