heartcombo / responders

A set of Rails responders to dry up your application
http://blog.plataformatec.com.br/
MIT License
2.05k stars 156 forks source link

Responders uninitialized constant #14

Closed shenoudab closed 14 years ago

shenoudab commented 14 years ago

Dears,

i got the below when running Responders master with rails3 master:

uninitialized constant ApplicationController::ApplicationResponder

Regards, Shenouda Bertel

josevalim commented 14 years ago

I cannot reproduce. Have you used responders:install generator? Is lib/application_responder.rb created? Have you explicitly required the responder?

shenoudab commented 14 years ago

ya ..

i used responders:install which created file lib/application_responder.rb

and also required the responder as follow :

require "application_responder" class ApplicationController < ActionController::Base self.responder = ApplicationResponder respond_to :html

Regards, Shenouda Bertel

josevalim commented 14 years ago

Strange. And what is the content of lib/application_responder.rb?

shenoudab commented 14 years ago

class ApplicationResponder < ActionController::Responder include Responders::FlashResponder include Responders::HttpCacheResponder

Uncomment this responder if you want your resources to redirect to the collection

path (index action) instead of the resource path for POST/PUT/DELETE requests.

include Responders::CollectionResponder

end

stevehodgkiss commented 14 years ago

I got the same error using edge rails in development mode, the lib dir is not added to the autoload path anymore (https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5018). Add config.autoload_paths += %W( #{config.root}/lib ) to application.rb to fix your issue.

josevalim commented 14 years ago

Fixed on Rails master, thanks!