Generated a resource scaffold for "wave"
It generated the wrong inflection "wafe" for singular instead of
"wave"
GET /waves(.:format) {:controller=>"waves", :action=>"index"}
waves POST /waves(.:format) {:controller=>"waves", :action=>"create"}
new_wafe GET /waves/new(.:format) {:controller=>"waves", :action=>"new"}
GET /waves/:id(.:format) {:controller=>"waves", :action=>"show"}
PUT /waves/:id(.:format) {:controller=>"waves", :action=>"update"}
wafe DELETE /waves/:id(.:format) {:controller=>"waves", :action=>"destroy"}
edit_wafe GET /waves/:id/edit(.:format) {:controller=>"waves", :action=>"edit"}
I added a correction to the inflector in
environment.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular "wave", "waves"
end
and tested a new app. The routes were generated correctly but
weren't recognized
GET /waves(.:format) {:controller=>"waves", :action=>"index"}
waves POST /waves(.:format) {:controller=>"waves", :action=>"create"}
new_wave GET /waves/new(.:format) {:controller=>"waves", :action=>"new"}
GET /waves/:id(.:format) {:controller=>"waves", :action=>"show"}
PUT /waves/:id(.:format) {:controller=>"waves", :action=>"update"}
wave DELETE /waves/:id(.:format) {:controller=>"waves", :action=>"destroy"}
edit_wave GET /waves/:id/edit(.:format) {:controller=>"waves", :action=>"edit"}
I get the same error when going to /waves (index action) as I
did before changing the inflector.
ActionView::Template::Error (undefined local variable or method "new_wave_path" for #<#<Class:0x1043eabc0>:0x1043e8848>):
22:
23: <br />
24:
25: <%= link_to "New Wave", new_wave_path %>
/Users/alanmccann/railsapps/wavetest/app/views/waves/index.html.erb:25:in _render_template_2110420769_2183084200_0
This issue doesn't happen when the inflector works correctly on
its own when a new scaffold is generated.