Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (45 sloc) 1.43 KB

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request