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.
This is a gem made of https://github.com/gustavosmanc/cute-alert alerts library to make your Rails app more user friendly
Install the gem and add to the application's Gemfile by adding:
gem cute_alert_rails
If bundler is not being used to manage dependencies, install the gem by executing:
gem install cute_alert_rails
config/importmap.rb
next:pin "cute_alert", to: "cute_alert.js"
app/assets/stylesheets/application.css
next:*= require cute_alert
app/views/layouts/application.html.erb
next:<%= javascript_include_tag 'cute_alert' %>
app/javascript/application.js
:import "cute_alert"
Done, you're great and now you're able to use these pretty alerts
First of all run bundle
to install gem
Now you can call it in console, for example
cuteToast({
type: 'success',
title: "Great",
message: "Product was successfully added",
timer: 5000
})
and you'll see little alert, if all works well
You can call it everywhere you want
Also a good practice will be to use Stimulus controller (if you use stimulus) to call this alerts:
rails g stimulus cutealert
# app/javascript/controllers/cutealert_controller.js
import { Controller } from "@hotwired/stimulus"
// Connects to data-controller="cutealert"
export default class extends Controller {
static targets = ["input"]
connect() {
}
successToast() {
cuteToast({
type: 'success',
title: "Great",
message: "Product was successfully added",
timer: 50000000000
})
}
}
<div data-controller="cutealert">
<%= form_with url: add_product_in_cart_path(product) do |f| %>
...
<%= f.submit "Add to cart", class: "btn-black", data: {
cutealert_target: "input",
action: "click->cutealert#successToast",
turbo: false } %>
<% end %>
</div>
Done, you've made it, enjoy
P.S. For full js documentation visit https://github.com/gustavosmanc/cute-alert
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cute_alert_rails. 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 CuteAlertRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that cute_alert_rails 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.
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.