Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting AbstractController::ActionNotFound instead of NameError when controller module is not defined #38149

Closed
ivandenysov opened this issue Jan 3, 2020 · 1 comment
Labels
more-information-needed When reporter needs to provide more information

Comments

@ivandenysov
Copy link
Contributor

ivandenysov commented Jan 3, 2020

Steps to reproduce

  1. define a simple controller that includes missing module
# app/controllers/showcase_include_bug_controller.rb
class ShowcaseIncludeBugController < ApplicationController
  include MadeUpModuleName

  def index
  end
end

# config/routes.rb
# ...
get "showcase_include_bug", to: "showcase_include_bug#index"
# ...
  1. launch rails server and go to http://localhost:3000/showcase_include_bug

Expected behavior

Rails should raise NameError (uninitialized constant MadeUpModuleName)

Actual behavior

Rails raises AbstractController::ActionNotFound (The action 'index' could not be found for ShowcaseIncludeBugController) or uses ancestor's implementation of index action (if present).

System configuration

Rails version: 6.0.2.1
Ruby version: 2.6.5

@rafaelfranca
Copy link
Member

rafaelfranca commented Jan 3, 2020

Have you tried with the 6-0-stable branch or the master branch? I believe this problem was already fixed in #37834.

@rafaelfranca rafaelfranca added the more-information-needed When reporter needs to provide more information label Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed When reporter needs to provide more information
Projects
None yet
Development

No branches or pull requests

2 participants