roar-rails icon indicating copy to clipboard operation
roar-rails copied to clipboard

errors when "Rendering from render"

Open ak47 opened this issue 10 years ago • 2 comments

the issue appears with the includes in the controller


class Api::V2::AppointmentsController 

in my rspecs, I consistently get:


Failure/Error: get "/api/v2/appointments/123"
     ActionController::RoutingError:
       undefined method `responder=' for Api::V2::AppointmentsController:Class
     # ./app/controllers/api/v2/appointments_controller.rb:2:in`include'

AND


 Failure/Error: get "/api/v2/appointments/#{@appointment.id}"
     AbstractController::ActionNotFound:
       The action 'show' could not be found for Api::V2::AppointmentsController

When remove those includes and use the alternative:


render json: AppointmentRepresenter.new(@appointment).to_json, status: :ok'

this works out as expected

Am I doing something wrong?

Ruby 2.1.2 Rails 4.1.5 Rspec 3.1.0

thanks

ak47 avatar Sep 30 '14 19:09 ak47

I remember this problem from a while ago (undefined method responder=') but thought we had it fixed. Can you find out where in Rails 4.1 the #responder= method is defined?

apotonick avatar Sep 30 '14 22:09 apotonick

Does that help? https://github.com/apotonick/roar-rails/issues/87

apotonick avatar Oct 02 '14 22:10 apotonick