Class: Effective::StyleGuideController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/effective/style_guide_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/effective/style_guide_controller.rb', line 5

def show
  @partials = view_paths.map { |path| Dir["#{path}/effective/style_guide/_**"] }.flatten.map do |path|
    name = File.basename(path)
    name[1...name.index('.') || name.length] # remove the _ and .html.haml
  end.uniq.sort

  @partials.delete('effective_datatable') unless defined?(EffectiveDatatables)

  @page_title ||= 'Style Guide'

  EffectiveStyleGuide.authorized?(self, :show, Effective::StyleGuide.new())
end