
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
The select2-rails
gem integrates the Select2
jQuery plugin with the Rails asset pipeline.
Add select2-rails
to your Gemfile and run bundle install
:
gem "select2-rails"
Add the following to your app/assets/javascripts/application.js
:
//= require select2
To add select2-full.js
instead of select2.js
, add the following instead :
//= require select2-full
Add to your app/assets/stylesheets/application.css
:
*= require select2
If you are using Twitter Boostrap you need to also require the bootstrap theme CSS in addition to the above require.
*= require select2-bootstrap
To apply the theme, tell Select2 to do so by passing bootstrap
to the theme
option when initializing Select2:
$( "#dropdown" ).select2({
theme: "bootstrap"
});
The select2-rails
now supports multiple languages.
Add the following to your app/assets/javascripts/application.js
:
//= require select2_locale_"any possible language"
To apply the language, pass whatever language you'd like to use to the language
option when initializing Select2:
$( "#dropdown" ).select2({
language: "zh-TW"
});
Possible languages:
af, ar, az, bg, bn, bs, ca, cs, da, de, dsb, el, en, eo, es, et, eu, fa, fi, fr, gl, he, hi, hr, hsb, hu, hy, id, is, it, ja, ka, km, ko, lt, lv, mk, ms, nb, ne, nl, pa, pl, ps, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-Cyrl, sv, th, tk, tr, uk, vi, zh-CN, zh-TW
Code here
Heroku app here
IE8 doesn't support some unescaped Unicode character and need to quote keys in object literals
You need some configurations for Uglifier to do the work.
Add to your config/environments/production.rb
require 'uglifier'
config.assets.js_compressor = Uglifier.new(output: {ascii_only: true, quote_keys: true})
From v2.1.0
on, select2-rails
's version will match the version of Select2
it uses.
The last number of the version is the patch version specific to the gem. For example, for a version of the form 2.x.y
, 2.x
is the release of Select2
we should be compatible with, and y is the patch version specific to the gem (ie. to resolve any gem-specific issues that crop up).
If you want to contribute, please:
Selec2-Rails is released under the MIT License.
FAQs
Unknown package
We found that select2-rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.