Module: Flair::StyleguideHelper
- Defined in:
- app/helpers/flair/styleguide_helper.rb
Instance Method Summary collapse
- #link_to_styleguide(label, url) ⇒ Object
-
#styleguide_block(section, &block) ⇒ Object
Generates a styleguide block.
Instance Method Details
#link_to_styleguide(label, url) ⇒ Object
4 5 6 |
# File 'app/helpers/flair/styleguide_helper.rb', line 4 def link_to_styleguide(label, url) link_to label, url, :class => ('active' if params[:id] == url.split('/').last) end |
#styleguide_block(section, &block) ⇒ Object
Generates a styleguide block. A little bit evil with @_out_buf, but if you’re using something like Rails, you can write a much cleaner helper very easily.
11 12 13 14 15 |
# File 'app/helpers/flair/styleguide_helper.rb', line 11 def styleguide_block(section, &block) @section = styleguide.section(section) @content = capture(&block) render 'flair/styleguides/styleguide_block' end |