HelloBar
Announcement plugin to include 'hello bar' into your app, for Ruby on Rails. Based on paul_revere.
You can show message in a specific time, inform users about news on the web and measure all clicks.
Install with the asset pipeline (Rails 3.1+, asset pipeline enabled)
Add this line to your application's Gemfile:
gem 'hello_bar'
Execute:
$ bundle
Run the generator to create the migration and routes:
rails generate hello_bar
Add the default announcement CSS to app/assets/stylesheets/application.css
:
//= require announcements
Add the helper to app/views/layouts/application.html.erb
:
<%= hello_bar %>
Run the migration:
rake db:migrate
Usage
HelloBar provides...
-
A model called
Announcement
, which has columns:- message (text column)
- link (string columns, mandtory)
- starts_at and ends_at (datetime columns, mandatory) You can use method "current" announcement.
-
A helper called
#hello_bar
, which will return current announcement. -
Tracking into Google Analytics event
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request