Sha256: 49185588b03c37a441b417cad765fa98ad020e8a51c76d495c5417547c2eae8d

Contents?: true

Size: 725 Bytes

Versions: 16

Compression:

Stored size: 725 Bytes

Contents

module Lookbook
  class PageController < ActionController::Base
    helper Lookbook::ComponentHelper
    helper Lookbook::PageHelper
    helper Lookbook::OutputHelper

    Lookbook.config.page_paths.each do |path|
      prepend_view_path Rails.root.join(path)
    end

    def render_page(page, locals = {})
      @page = page
      @pages = Lookbook.pages
      @next_page = @pages.find_next(@page)
      @previous_page = @pages.find_previous(@page)
      content = render_to_string inline: @page.content, locals: {
        page: @page,
        next_page: @next_page,
        previous_page: @previous_page,
        pages: @pages
      }
      @page.markdown? ? Lookbook::Markdown.render(content) : content
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lookbook-1.2.1 app/controllers/lookbook/page_controller.rb
lookbook-1.2.0 app/controllers/lookbook/page_controller.rb
lookbook-1.1.1 app/controllers/lookbook/page_controller.rb
lookbook-1.1.0 app/controllers/lookbook/page_controller.rb
lookbook-1.0.8 app/controllers/lookbook/page_controller.rb
lookbook-1.0.7 app/controllers/lookbook/page_controller.rb
lookbook-1.0.6 app/controllers/lookbook/page_controller.rb
lookbook-1.0.5 app/controllers/lookbook/page_controller.rb
lookbook-1.0.4 app/controllers/lookbook/page_controller.rb
lookbook-1.0.3 app/controllers/lookbook/page_controller.rb
lookbook-1.0.2 app/controllers/lookbook/page_controller.rb
lookbook-1.0.1 app/controllers/lookbook/page_controller.rb
lookbook-1.0.0 app/controllers/lookbook/page_controller.rb
lookbook-1.0.0.rc.3 app/controllers/lookbook/page_controller.rb
lookbook-1.0.0.rc.2 app/controllers/lookbook/page_controller.rb
lookbook-1.0.0.rc.1 app/controllers/lookbook/page_controller.rb