Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clipboard-toastr-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipboard-toastr-rails

  • 1.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

clipboard-toastr-rails

Gem
Version Build
Status

clipboard-toastr-rails gem is the integration of clipboard.js and toastr javascript library(using 2.2 Version) for your Rails 4, 5 application.

Ruby gems url: https://rubygems.org/gems/clipboard-toastr-rails

Installation

Add this line to your application's Gemfile:

gem 'clipboard-toastr-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install clipboard-toastr-rails

Now you need to edit your app/assets/javascripts/application.js file and add the following line:

//= require clipboard-toastr

And you need to edit your app/assets/stylesheets/application.css file and add the following line:

*= require toastr

If Use app/assets/stylesheets/application.scss file

@import "toastr";

Usage

Here is the example working code to test with your Rails application.

Add this sample code to your app/assets/javascripts/application.js file

$(document).ready(function(){

  clip = new Clipboard('.copy-target')

  toastr.options = {
    "positionClass": "toast-bottom-center",
    ....
    ....
  }

  $(".copy-target").click(function() {
    toastr.info "Copy Success Alert"
  });

  target_clip = new Clipboard('.copy-target1')

  toastr.options = {
    "positionClass": "toast-top-center",
    ....
    ....
  }

  $(".copy-target1").click(function() {
    toastr.info "Copy Success Alert"
  });




});

<html>
  <head>
  ...
  </head>

  <body>
    ...
    ...

    <input id="copy-content" value="This is Copy Content"/>

    <span class="copy-target1" data-clipboard-target="#copy-content">Copy This Content</span>

    ...
    ...

    <span class="copy-target" data-clipboard-text="COPY CONTENT">Copy Link</span>

    ...
    ...
  </body>

</html>

Full documentation

The Documentation is at

Clipboard.js Document

Toastr Document

Change Log

Current Version 1.3.0

This link listing Change Log

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

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 11 Apr 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc