forrest/prawnto — Issue #9: Prawnto fails to register prawn handler
Author: jenshz
Created: 2012-02-25 15:51:39+00:00
State: open

This problem took me 2.5 hours of bug-hunting:

Sometimes the prawn handler will not be registered when the initializer is loaded in the Railtie.

Adding the following lines at the end of the lib/prawnto/railtie.rb file and commenting out the other two lines in the top of the file fixes the problem for me.

ActiveSupport.on_load(:action_view) do
ActionView::Template.register_template_handler :prawn, Prawnto::TemplateHandlers::Base
end

I have no idea why this happens - just looked af the coffee-rails trying to find the difference while not loosing too much hair.

Hope this can somehow help others.