Getting "undefined method `flash`" for my controllers after updating Rails from 4.1 to 5.2 and added the responders gem

612 views Asked by At

I'm in the process of updating rails from 4.1 to 5.2 I added the responders gem so respond_with is present. My ApplicationController now looks like this:

class ApplicationController < ActionController::API self.responder = ApplicationResponder respond_to :html

However, when I call respond_with I get this error:

 NoMethodError: undefined method `flash' for #<MyController>

I noticed in the responders README that there is a flash responder, however I do not want to use that.

1

There are 1 answers

0
Abhishek Tanwar On

add the following line to "config/environments/production.rb"

config.middleware.use ActionDispatch::Flash