I'm not sure why but recently I tried changing my route for adding a new project to
/project/new and instead of rendering new.html.haml it renders show.html.haml and new is the parameter.
Inside my routes.rb
Mika::Application.routes.draw do
root "pages#home"
get '/contact' => "pages#contact"
get '/about' => 'pages#about'
get '/privacy' => 'pages#privacy'
get '/tos' => 'pages#terms_of_service'
post '/contact' => 'messages#contact'
resources :projects, :only => [:index, :show]
resources :projects, :only => [:update, :edit, :create, :post, :new], :constraints => { :subdomain => 'admin' }
end
I'm not entirely sure where to look to correct this issue or even when to start
In terminal I'm getting this
Started GET "/projects/new" for 127.0.0.1 at 2014-05-16 15:23:20 -0700
Processing by ProjectsController#show as HTML
Parameters: {"id"=>"new"}
Rendered projects/show.html.haml within layouts/application (0.1ms)
Rendered layouts/_shim.html.haml (0.8ms)
Rendered layouts/_header.html.haml (0.5ms)
Rendered layouts/_footer.html.haml (0.2ms)
Rendered layouts/_javascript.html.haml (0.0ms)
Rendered layouts/_analytics.html.haml (0.0ms)
Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.0ms)
*EDIT Changing the routes file to this works
resources :projects, :only => [:update, :edit, :create, :post, :new], :constraints => { :subdomain => 'admin' }
resources :projects, :only => [:index, :show]
but it's still rendering create for parameters that don't exist with a blank page as the result