Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This gem is intended to clean up RoR views for jQuery toggling between hidden and visible elements.
<%= will_toggle label: 'Change Your Password',
partial: 'users/password_fields',
checked: false,
locals: { f: f } %>
Just like that, you now have a check_box_tag
that will display the password_fields
partial when checked, and hide it from view when unchecked. This becomes very handy in complex forms when you want to hide certain fields from a user until they actively enable a feature.
A check_box_tag
is added with label_tag 'Change Your Password'
. The checkbox is wired in to the onchange
event, which triggers a jQuery function to toggle a will-toggle-wrapper
that encapsulates the partial. Will Toggle allows you to abstract out the javascript functions, div wrappers, and other view elements so that your HTML/ERB/HAML is simple and organized.
Currently will_toggle only supports a checkbox toggle, however, you can expect many more implementations to come.
Add this line to your application's Gemfile:
gem 'will_toggle'
And then execute:
$ bundle install
Or, install it yourself as:
$ gem install will_toggle
In your application.js, you will have to include will_toggle's scripts with:
//= require will_toggle
A minimalist:
<%= will_toggle label: 'Change Your Password', partial: 'users/password_fields', locals: { f: f } %>
All the bells and whistles:
<%= will_toggle label: 'Add Your Twitter Account',
partial: 'users/fields/twitter',
checked: false,
clear_data: true,
locals: { f: f } %>
label
: the string you will use to describe the toggled div, i.e. show details.checked
: true or false, defaults to false. Specifies whether the checkbox will be checked.locals
: a hash of necessary variables for your partial.clear_data
: true or false, defaults to false. If true, the toggle function will clear any values in any child text_field
upon toggle. Especially useful for optional form fields.git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)This gem is inspired by will_paginate
FAQs
Unknown package
We found that will_toggle 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.