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

select_all-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

select_all-rails

  • 0.3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

select_all-rails

Simple to check and uncheck checkboxes


Gem Version Build Status Code Climate Issue Count

Select_all-rails is gem for implementing 'select-all' functionality in more simple and effective way in your ruby-on-rails application.

Functionalities

  • Basic Usage - Selecting/Unselecting multiple checkboxes.
  • Multiple Seletions - Implementing more than one select-all functionalities in a page.
  • Ajax Added Checkboxes - Implementing select-all functionality to new checkboxes added by an Ajax call.
  • Show Selection/Count - Display selected checkboxes count or checkboxes remaining to select count or selected checkboxes count out of total checkboxes.

Installation

Add this line to your application's Gemfile:

gem 'select_all-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install select_all-rails

And add the following line to your application.js file after jquery:

//= require select_all.js

Usage

Call the function select_all() on main checkbox and add class 'selectable' to sub-checkboxes.

HTML example:

<input type="checkbox" id="selectAll">All Items</input>

<input type="checkbox" class="selectable">Item 1</input>
<input type="checkbox" class="selectable">Item 2</input>
<input type="checkbox" class="selectable">Item 3</input>

<script type="text/javascript">
    $("#selectAll").select_all();
</script>

For more usage checkout Demo

Rails haml example:

= check_box_tag 'checkAll'
= check_box_tag 'selected_ids[]', "1", false, class: 'selectable'
= check_box_tag 'selected_ids[]', "2", false, class: 'selectable'
= check_box_tag 'selected_ids[]', "3", false, class: 'selectable'

:javascript
    $("#checkAll").select_all();

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/select_all-rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 06 Sep 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