StatusTagFor
ActiveAdmin component which shows predicate as status.
Installation
Add this line to your application's Gemfile:
gem 'status_tag_for'
And then execute:
$ bundle
Or install it yourself as:
$ gem install status_tag_for
Usage
status_tag_for(true)
# => <span class='status_tag_for yes ok'>Yes</span>
status_tag_for(false)
# => <span class='status_tag_for no warn'>No</span>
status_tag_for(user.active?, user.status)
# => <span class='status_tag_for active ok'>Active</span>
status_tag_for(true, 'Yep', 'Nope')
# => <span class='status_tag_for yep ok'>Yep</span>
status_tag_for(false, 'Yep', 'Nope')
# => <span class='status_tag_for nope warn'>Nope</span>
Contributing
- Fork it ( https://github.com/SPBTV/status_tag_for/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request