undefined method respond_to in Rails 5 controller
Asked Answered
F

1

13

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
Forbiddance answered 26/7, 2016 at 22:5 Comment(2)
You have to add gem 'responders' to your Gemfile.Schiller
See here #35984128Mechanize
O
24

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.

Outhe answered 27/7, 2016 at 2:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.