Class: StyleguideController

Inherits:
ActionController::Base
  • Object
show all
Extended by:
ActiveSupport::Memoizable
Defined in:
app/controllers/styleguide_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize_stylesheets_path_configObject

Set up the stylesheets configuration



7
8
9
10
# File 'app/controllers/styleguide_controller.rb', line 7

def self.initialize_stylesheets_path_config
  self.config.stylesheets_path ||= {}
  self.config.stylesheets_path[:default] ||= File.join(Rails.root, Rails.application.paths["app/assets"], "stylesheets")
end

Instance Method Details

#showObject

Show a styleguide



22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/styleguide_controller.rb', line 22

def show 
  id = params[:id]
  id ||= :default

  @styleguide = styleguide(id)

  respond_to do |format|
    format.html { render id.to_s }
  end
end