
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
rails-jquery-tokeninput
Advanced tools
Integrating Tokeninput jQuery plugin version 1.6.1.
Add this line to your application's Gemfile:
gem 'rails-jquery-tokeninput'
And then execute:
$ bundle
Require jquery.tokeninput.js in your application.js:
//= require rails-jquery-tokeninput
Add the stylesheets you want to use in your application.css:
*= require token-input-facebook
To start using gem you just have to add data-attribute to your text input:
names = [{ id: 1, name: 'John' }, { id: 2, name: 'Mike' }]
f.text_field :names, 'data-tokeninput' => { collection: names }.to_json
Or if you are using Simple Form or Formtastic it may looks like:
countries = [{ name: 'Hong Kong', iso_code: 'HK' }, { name: 'Jamaica', iso_code: 'JM' }]
options = { theme: 'facebook', tokenValue: 'iso_code' }
f.input :countries, as: :string, input_html: {
data: { tokeninput: { collection: countries, options: options } }
}
It will automatically pass input values to your controller like an array (works well with pg_array).
It also automatically pre populate existed items.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rails-jquery-tokeninput demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.