Class: Effective::StyleGuideController

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

Instance Method Summary collapse

Instance Method Details

#bootstrap3Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/effective/style_guide_controller.rb', line 18

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

  @partials = @partials.reject { |p| p.start_with?('_') } # Remove any double __ partials

  @page_title ||= 'Style Guide'

  EffectiveStyleGuide.authorize!(self, :show, Effective::StyleGuide.new())

  render 'effective/style_guide_bootstrap3/show'
end

#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 = @partials.reject { |p| p.start_with?('_') } # Remove any double __ partials

  @page_title ||= 'Style Guide'

  EffectiveStyleGuide.authorize!(self, :show, Effective::StyleGuide.new())
end