Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method respond_to in Rails 5 controller

I'm upgrading an app from rails 3.something to rails 5. For some reason, I'm am getting undefindied method respond_to anytime I use that method in any of my controllers. This was working before and I was hoping someone here could help.

class StatusController < ApplicationController

  #this throws an error 'undefined method respond_to
  respond_to :json, :html     
 end
like image 912
xeroshogun Avatar asked Jul 26 '16 22:07

xeroshogun


1 Answers

As per Rails 5 release notes,

Remove respond_to/respond_with placeholder methods, this functionality has been extracted to the responders gem.

Add responders gem to your Gemfile.

like image 73
Pramod Avatar answered Sep 29 '22 22:09

Pramod