lib/render_anywhere.rb in render_anywhere-0.0.9 vs lib/render_anywhere.rb in render_anywhere-0.0.10
- old
+ new
@@ -6,22 +6,25 @@
module RenderAnywhere
def render(*args)
rendering_controller.render_to_string(*args)
end
+
def set_render_anywhere_helpers(*args)
args.each do |helper_name|
rendering_controller.class_eval do
helper helper_name.to_s.constantize
end
end
end
+
def set_instance_variable(var, value)
rendering_controller.class_eval do
attr_accessor :"#{var}"
end
rendering_controller.public_send("#{var}=", value)
end
+
def rendering_controller
- @rendering_controller ||= RenderAnywhere::RenderingController.new
+ @rendering_controller ||= self.class.const_get("RenderingController").new
end
end