Socket
Book a DemoInstallSign in
Socket

bootstrap_notify

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap_notify

0.0.5
bundlerRubygems
Version published
Maintainers
2
Created
Source

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 http://goodybag.github.com/bootstrap-notify/

You can see a demo at: http://goodybag.github.com/bootstrap-notify

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

Requirements:

Installation

Add it to your Gemfile:

gem 'bootstrap_notify', 'v0.0.5'

v0.0.5 - Sprockets 3 support

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";

Implementation

Quick and Dirty style:

Create a partial with the contents

  # app/views/partials/_notify.html.haml
  - if !notice.blank?
    :javascript
      $(document).ready(function () {
        $('.top-right').notify({
          message: { text: "#{notice}" }
        }).show();
      });

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
  .notifications.top-right

Additional configuration and placement options can be found at: http://goodybag.github.com/bootstrap-notify

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";

FAQs

Package last updated on 18 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.