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.
EasyTable provides a helper for building HTML tables in Rails applications.
It is inspired by simple_form gem: https://github.com/plataformatec/simple_form
Add this line to your application's Gemfile:
gem "easy_table"
And then execute:
$ bundle
For a working Rails 4.2 sample code see: cthulhu666/easy_table_sample
All examples below assume that You are using Haml. Please, use Haml !
= table_for(@people) do |t|
- t.column :name
- t.column :surname
This produces:
%table
%thead
%tr
%th name
%th surname
%tbody
%tr#person-1
%td John
%td Doe
Assuming @people
is a collection consisting of one record, person with id = 1, John Doe
= table_for(@people, class: 'people') do |t|
- t.column :name, class: 'name' do |person|
- person.name.downcase
- t.column :surname, class: lambda { |person| ['surname', person.surname.length > 5 && 'long'].compact } do |person|
- person.surname.upcase
This produces:
%table.people
%thead
%tr
%th name
%th surname
%tbody
%tr#person-1
%td.name john
%td.surname DOE
%tr#person-2
%td.name alice
%td.surname.long COOPER
Assuming @people
is a collection consisting of two records:
= table_for(@people) do |t|
- t.span 'personal data' do |s|
- s.column :name
- s.colunm :surname
- t.span 'contact data' do |s|
- s.column :email
- s.column :phone
This produces:
%table
%thead
%tr
%th{colspan: 2, scope: 'col'} personal data
%th{colspan: 2, scope: 'col'} contact data
%tr
%th name
%th surname
%th email
%th phone
%tbody
%tr#person-1
%td John
%td Doe
%td john.doe@gmail.com
%td 123456789
en:
easy_table:
person: # this is matched based on controller_name.singularize
name: 'Name'
surname: 'Surname'
With following form definition
= table_for(@people) do |t|
- t.column :name
- t.column :surname
It will use 'Name' and 'Surname' as column header labels:
%table
%thead
%tr
%th Name
%th Surname
You can also explicitly set column header passing it as a second argument to column
and span
methods:
= table_for(@people) do |t|
- t.column :name, 'Name'
- t.column :surname, 'Surname'
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that easy_table 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.