I have a rails3 app. I found an issue where rails has created an incorrect singularization of one of my models.
rails generate model tradie
produces trady (singular), and (tradies) plural.
I’ve fixed this by adding an inflection.
config/initializers/inflection.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'tradie', 'tradies'
end
Now my routes have changed from
new_trady_path to new_tradie_path
breaking my existing views.
Can I override the routes to keep trady_path so I don’t need to go through and update all my views.
Add it to your app/helpers/application_helper.rb
That will add this method to all your views, and you can use the new method to get the path.
Alternatively, I would just do
or similar.