Sha256: 72167a97dbf9de67a1e8011c6b0afa9aa6ebcc99aabb2d2be24e347059fef97d

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module Renderful
  class Renderer
    class Rails < Renderer
      def render
        renderer.render(partial: view, locals: locals.merge(default_locals))
      end

      private

      def renderer
        ActionController::Base.renderer
      end

      def locals
        {}
      end

      def view
        "renderful/#{entry.content_type.id.demodulize.underscore}"
      end

      def default_locals
        { entry: entry, client: client, renderer: self }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
renderful-0.2.0 lib/renderful/renderer/rails.rb
renderful-0.1.0 lib/renderful/renderer/rails.rb