Created
October 22, 2014 21:27
-
-
Save trushkevich/ab9546813709b0f9dafc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Renderable | |
def renderer | |
return @renderer if @renderer | |
@renderer = ActionView::Base.new(Rails.configuration.paths["app/views"]) | |
@renderer.class_eval do | |
include Rails.application.routes.url_helpers | |
include ApplicationHelper | |
define_method :default_url_options, -> { Rails.application.config.action_mailer.default_url_options } | |
def protect_against_forgery? | |
false | |
end | |
end | |
@renderer | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
render anything anywhere