
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Just add JSON on HTML notifications in your APP
Designed for Bootstrap 3 style of for toastr notifications
Just remove
<%= form_for(@resource) do |f| %>
<% if @resource.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@resource.errors.count, "error") %> prohibited this resource from being saved:</h2>
<ul>
<% @resource.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
# ....
<% end %>
with
<%= form_for(@post) do |f| %>
<%= render partial: 'the_notification/form', locals: { object: @post } %>
# ....
<% end %>
and add to Layout
<body>
<%= render partial: 'the_notification/flash' %>
<%= yield %>
application.css
*= require bootstrap
*= require the_notification/vendors/toastr
application.js
//= require the_notification/vendors/toastr
//= require the_notification
$ ->
TheNotification.show_notifications()
<%= render partial: 'the_notification/flash', locals: { format: :html } %>
<%= render partial: 'the_notification/form', locals: { object: @post, format: :html } %>
or
<%= render partial: 'the_notification/flash', locals: { format: :json } %>
<%= render partial: 'the_notification/form', locals: { object: @post, format: :json } %>
initializers/the_notification.rb
TheNotification.configure do |config|
config.default_type = :json # :html
end
models/user.rb
class Post < ActiveRecord::Base
include TheNotification::LocalizedErrors
end
config/locales/ru.yml
activerecord:
models:
post: Публикация
attributes:
post:
title: "Загловок"
Now errors messages will looks like this:
Загловок: не может быть пустым
instead
Title: не может быть пустым
gem 'the_notification'
$ bundle
TODO: Write usage instructions here
FAQs
Unknown package
We found that the_notification 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.