Permalink
Browse files

allow folks to pass in their own content to put in the badge

  • Loading branch information...
1 parent 646370d commit 727fcd033822d74a3b43eacc9a673879515220e8 Jamie Kite committed Jun 24, 2011
Showing with 12 additions and 3 deletions.
  1. +8 −0 README.markdown
  2. +1 −1 TODO.markdown
  3. +3 −2 app/helpers/honey_badger/application_helper.rb
View
@@ -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):
/*
View
@@ -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
@@ -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

0 comments on commit 727fcd0

Please sign in to comment.