Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
= Nested Form
A Rails gem to conveniently manage multiple nested models in a single form. It does so in an unobtrusive way through jQuery.
To learn more about how this works under the hood: http://blog.madebydna.com/dynamic-nested-forms-in-rails-3-with-the-nest
== Install
Add it to your Gemfile
gem "nested_form", :git => "git://github.com/madebydna/nested_form.git"
Run
bundle install
Run the generator
rails generate nested_form:install
== Usage
Running the generator will add a file at public/javascripts/nested_form.js which should be included after jQuery.
<%= javascript_include_tag 'jquery', 'nested_form' %>
You can then generate a nested form using the nested_form_for helper method.
<%= nested_form_for @project do |f| %>
Use this form just like normal, including the fields_for helper method for nesting models. The benefit of this plugin comes from the link_to_add and link_to_remove helper methods on the form builder.
<%= f.fields_for :tasks do |task_form| %> <%= task_form.text_field :name %> <%= task_form.link_to_remove "Remove this task" %> <% end %> <%= f.link_to_add "Add a task", :tasks %>
This generates links which dynamically add and remove fields.
== Partials
It is often desirable to move the nested fields into a partial to keep things organized. If you don't supply a block to fields_for it will look for a partial and use that.
<%= f.fields_for :tasks %>
In this case it will look for a partial called "task_fields" and pass the form builder as an f variable to it.
== Special Thanks
This gem is based on the plugin by Ryan Bates: http://github.com/ryanb/nested_form
FAQs
Unknown package
We found that nested_form_tougg 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.