
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
meta_tags_simple_builder
Advanced tools
Gem allow you to simply create seo friendly custom meta tags, blocks of meta tags.
rails >= 4.0.0
Add this line to your application's Gemfile:
gem 'meta_tags_simple_builder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install meta_tags_simple_builder
<%= title_meta_tag('MetaTagsSimpleBuilder gem page.')%>
# <title>MetaTagsSimpleBuilder gem page.</title>
Use title for layout helper if you want to set title for application from view and caption view name:
# application.html
<%= title_meta_tag(yield(:title))%>
# <title>Title for application from view.html</title>
# views.html
<h1>
<%= title_for_layout('Title for application from view.html')%>
</h1>
# <h1>Title for application from view.html</h1>
<%= charset_meta_tag('utf-16')%>
# <meta charset="utf-16" />
<%= http_equiv_meta_tag('X-UA-Compatible', 'IE=Edge')%>
# <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<%= author_meta_tag('Marat Khusnetdinov')%>
# <meta content="Marat Khusnetdinov" name="author" />
<%= keywords_meta_tag(['gem', 'rails'])%>
<%= keywords_meta_tag('gem, rails')%>
# <meta content="gem, rails" name="keywords" />
<%= description_meta_tag('Gem for simply creating meta tags, blocks of meta tags')%>
# <meta content="Gem for simply creating meta tags, blocks of meta tags" name="description" />')
<%= viewport_meta_tag('width=1')
# <meta content="width=1" name="viewport" />'
<%= viewport_meta_tag(['width=1', 'scale=1'])
# <meta content="width=1, scale=1" name="viewport" />'
This helper helps you to set meta tag with custom name:
<%= meta_tag_for :robots, 'noindex'>
# <meta content="noindex" name="robots" />
Use custom meta tags if you want more flexibility:
<%= custom_meta_tag_for(:custom_property, 'cutstom content', custom_options: 'custom content for options')%>
# <meta custom-property="cutstom content" custom-options="custom content for options" />
Notice: "_" underscore in attributes simbol names will be rendered to "-" dash
<%= link_tag_for :canonical, url: 'http://github.com', type: 'web')%>
# <link rel="canonical" url="http://github.com" type="web" />')
Blocks helpers are used than you need render collection meta tags. It takes a hash, which you can create in controller.rb:
# somewhere in controller we create and want to render this:
@meta = { title: 'Page title', charset: 'utf-16', author: 'John Doe', namespace: { title: 'content', attr_name: :property} }
# application.html
<%= meta_tags_block_for(@meta)%>
# <title>Page title</title>
# <meta charset="utf-16" />
# <meta content="John Doe" name="author" />
# <meta content="content" property="namespace:title" />
Notice: If you pass a pair key: :value with value as hash, key: will be the namespace of name attribute. For change 'name' attribute pass options :attr_name.
Links block have options:
@links = { prev: { href: 'http://github.com/prev', type: 'web' }, next: { href: 'http://github.com/next'} }
<%= link_tags_block_for(@links)%>
# <link href="http://github.com/prev" rel="prev" type="web" />
# <link href="http://github.com/next" rel="next" />
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.