I have rails 4 app with an admin namespace and a model called Gametime
namespace :admin do
resources :gametimes
end
the model is game_time.rb
class GameTime < ActiveRecord::Base
end
The index and show action work fine. I am having a problem with the new action.
gametimes_controller.rb
def new
@gametime = GameTime.new
end
new.html.erb
<% form_for [:admin, @gametime ] do |f| %>
<% end %>
I get this error
NoMethodError at /admin/gametimes/new
undefined method `admin_game_times_path' for #<#<Class:0xae0d74c>:0xae0c2c0
Request parameters
{"action"=>"new", "controller"=>"admin/gametimes"}
The routes show this
new_admin_gametime GET /admin/gametimes/new(.:format) admin/gametimes#new
I don't see why it putting the path as "game_time" rather than "gametime" ?