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.
custom_form_generator
Advanced tools
CustomFormGenerator is a Ruby gem designed to dynamically generate HTML forms and tables based on JSON configurations. It leverages the Slim templating engine to render forms, filter, sort options, and tabular views.
Add this line to your application's Gemfile:
gem 'custom_form_generator', path: '/path/to/custom_form_generator'
And then execute:
bundle install
To use CustomFormGenerator, you need to provide few JSON and YAML files that defines the structure of your form or table. Currently supporting use cases of 4 such files:
- type: textfield
label: Name
key: properties.name
id: name_input
class: form-control
- type: dropdown
label: Language
key: language
id: language_select
class: form-select
disabled: true
[
{
"_id": { "$oid": "64df" },
"language": "jp",
"name": "Kishimoto S",
"properties": {
"name": "Kishimoto S",
"categories": ["/Yusuke/Urameshi"],
"sku": "B3743-B001"
}
}
]
{
"sort": [
{ "key": "name", "label": "Name" },
{ "key": "created_at", "label": "Created At" }
],
"filter": [
{ "key": "language", "label": "Language" },
{ "key": "published_at", "label": "Published At", "type": "radio", "options": ["all", "yes", "no"], "default": "all" }
],
"order_by": [
{ "key": "asc", "label": "Ascending" },
{ "key": "desc", "label": "Descending" }
]
}
- key: images_url
label: Image
id: image_column
class: table-column
- key: properties.name
label: Name
id: name_column
class: table-column
require 'custom_form_generator'
generator = CustomFormGenerator::Generator.new(
'path/to/form.yml',
'path/to/data.json',
'path/to/config.json',
'path/to/table.yml'
)
# Generate form
html_form = generator.generate_form
# Generate filter and sort
filter_html = generator.generate_filter_and_sort
# Generate table view
table_html = generator.generate_tabular_view(data)
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests.
Bug reports and pull requests are welcome on GitHub at https://github.com/Manmohan-menon/SlimForms_gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the CustomFormGenerator project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that custom_form_generator demonstrated a healthy version release cadence and project activity because the last version was released less than 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.