Sha256: 17afb91fcf587922b01f41f950af51bd00786d8808d0e6dd75228fed265636e7

Contents?: true

Size: 341 Bytes

Versions: 6

Compression:

Stored size: 341 Bytes

Contents

module Cmor
  module Core
    class MarkupViewHelper < Rao::ViewHelper::Base
      def render(object, method)
        handler = object.send(method)
        return if handler.nil?
        erb_string = ::ERB.new(object[method.to_sym].to_s, 0).result(binding)
        handler.class.new(erb_string).to_html.html_safe
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cmor_core-0.0.6.pre app/view_helpers/cmor/core/markup_view_helper.rb
cmor_core-0.0.5.pre app/view_helpers/cmor/core/markup_view_helper.rb
cmor_core-0.0.4.pre app/view_helpers/cmor/core/markup_view_helper.rb
cmor_core-0.0.3.pre app/view_helpers/cmor/core/markup_view_helper.rb
cmor_core-0.0.2.pre app/view_helpers/cmor/core/markup_view_helper.rb
cmor_core-0.0.1.pre app/view_helpers/cmor/core/markup_view_helper.rb