Skip to content

Commit

Permalink
allow folks to pass in their own content to put in the badge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Kite committed Jun 24, 2011
1 parent 646370d commit 727fcd0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.markdown
Expand Up @@ -8,6 +8,14 @@ In your application view somewhere, just render the honey_badger helper:

= honey_badger

If you want to display something other than the current environment name, just pass it in:

= honey_badger "Don't Care!"

Or pass in an array to display more than one interesting fact in your badge (each will be displayed on its own line):

= honey_badger ["eats larva", "skin is loose"]

In your stylesheet (using Rails 3.1 sprockets awesomeness):

/*
Expand Down
2 changes: 1 addition & 1 deletion TODO.markdown
@@ -1,4 +1,4 @@
* allow folks to pass in their own content to put in the badge
* <strike>allow folks to pass in their own content to put in the badge</strike>
* allow overriding the environment based colors and what environments it
shows up for
* sexy documentation page showing how things work
Expand Down
5 changes: 3 additions & 2 deletions app/helpers/honey_badger/application_helper.rb
@@ -1,8 +1,9 @@
module HoneyBadger
module ApplicationHelper
def honey_badger
def honey_badger(text=Rails.env)
content_tag :div, :class => "corner-banner honey-badger #{Rails.env}" do
Rails.env.html_safe
text = text.join('<br/>') if text.instance_of?(Array)
text.html_safe
end
end
end
Expand Down

0 comments on commit 727fcd0

Please sign in to comment.