Sha256: cba5d7e1c542235ba89c81cfd8f297a4b3cbfcc1b288313f4b209a723b8a4200

Contents?: true

Size: 709 Bytes

Versions: 4

Compression:

Stored size: 709 Bytes

Contents

require 'abstract_controller'
require 'action_view'

require 'render_anywhere/version'
require 'render_anywhere/rendering_controller'

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 ||= self.class.const_get("RenderingController").new
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
render_anywhere_lxv-0.0.12 lib/render_anywhere.rb
render_anywhere-0.0.12 lib/render_anywhere.rb
render_anywhere-0.0.11 lib/render_anywhere.rb
render_anywhere-0.0.10 lib/render_anywhere.rb