Class: Lookbook::PageController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/lookbook/page_controller.rb

Instance Method Summary collapse

Instance Method Details

#render_page(page, locals = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'app/controllers/lookbook/page_controller.rb', line 11

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
  @page.markdown? ? Lookbook::Markdown.render(content) : content
end