This is a rails gem that includes the bootstrap-notify styles.
JavaScript Ruby CSS
Switch branches/tags
Nothing to show
Latest commit 80c1419 Sep 16, 2013 @jclay jclay updating readme

Bootstrap Notify - Rails notifications made easy.

BootstrapNotify aims to be a simple notification system that you can easily drop into your Rails project for nice looking notify flashes. BootstrapNotify is based off of bootstrap-notify by user goodybag

You can see a demo at:

This is a based off of my SCSS conversion of bootstrap-notify.



Add it to your Gemfile:

gem 'bootstrap_notify', :git => ""

Include the javascripts in application.js. Make sure to include after jQuery:

//= require jquery
//= require jquery_ujs
//= require bootstrap_notify

Import the SCSS after you import bootstrap:

@import "bootstrap";
@import "bootstrap_notify";


Quick and Dirty style:

Create a partial with the contents

  # app/views/partials/_notify.html.haml
  - if !notice.blank?
      $(document).ready(function () {
          message: { text: "#{notice}" }

Render the partial in your layout with the <head> tag, after your javascript and CSS have been included.

  # app/views/layouts/application.html.haml
  = render(:partial => "partials/notify")

Don't forget to include the div to attach the notification to:

  # app/views/layouts/application.html.haml

Additional configuration and placement options can be found at:

Customizing Placement

You can offset the placement of the notification by adjusting the top, bottom, left or right variables.

$notify_right: 100px;
$notify_left: $notify_right;
$notify_top: 500px;
$notify_bottom: $notify_top;
@import "bootstrap_notify";