Skip to content

Commit

Permalink
Merge pull request #18 from jankeesvw/throw-error-when-style-is-missing
Browse files Browse the repository at this point in the history
Show error to tell developer they added a styleguide block for an undefined section
  • Loading branch information
Garrett Bjerkhoel committed Feb 14, 2013
2 parents 5b8f2a3 + 0c3852e commit 048ed7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/helpers/kss/application_helper.rb
Expand Up @@ -7,6 +7,11 @@ def styleguide_block(section, &block)
raise ArgumentError, "Missing block" unless block_given?

@section = styleguide.section(section)

if !@section.raw
raise "KSS styleguide section is nil, is section '#{section}' defined in your css?"
end

content = capture(&block)
render 'kss/shared/styleguide_block', :section => @section, :example_html => content
end
Expand Down

0 comments on commit 048ed7e

Please sign in to comment.