rails/rails — Issue #3465: View template gets rendered without corresponding controller action
Author: flippingbits
Created: 2011-10-29 22:42:36+00:00
State: open

Hi,
I've faced a strange behavior that's IMHO not intended.

Let's say that I've a freshly generated Rails 3.1.1 application.
When I generate the controller `FooController`, define the following route

MyApplication::Application.routes.draw do
get "foo-bar", :to => "foo#bar"
end

touch the view template `app/views/foo/bar.html.erb` and call `http://localhost:3000/foo-bar` then the view template gets rendered.

IMHO this should not happen since no corresponding controller action exists.

What do you think. Is this a bug? If yes, I'd love to provide a pull request.
If not, I'm sorry for the noise :)

Cheers