-
Notifications
You must be signed in to change notification settings - Fork 21.9k
Closed
Description
Steps to reproduce
Create a new Rails controller
class IndexController < ApplicationController
call_to_a_function_that_does_not_exist
def index
puts "we are here"
end
end
and register a route for it
# routes.rb
get "/", to: 'index#index'
Expected behavior
I'd expect to see and error like this in logs or webpage
NameError: undefined local variable or method `call_to_a_function_that_does_not_exist' for IndexController:Class
Actual behavior
If views/index/index.erb.html
exists, Rails displays that view (but clearly isn't executing our index
method, "we are here" is not in logs). Otherwise it shows an error that says "The action 'index' could not be found for IndexController".
System configuration
Rails version: 6.0.2.1
Ruby version: 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]