Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
rails_responsive_rater
Advanced tools
A simple client-side rating system packaged up as a gem for Rails projects.
This project was created because I was not happy with any of the existing rating plugins I found for Rails. Mainly because they all relied on images (usually stars) for the rating display. I think a better approach is to make use of unicode symbols and CSS so that the rating display can easily be made responsive without the associated hassles of using images.
Add this line to your application's Gemfile:
gem 'rails_responsive_rater'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails_responsive_rater
Once the gem has been installed you can attempt to have it add the necessary require statements to your application.js and application.css for you:
$ rails generate rails_responsive_rater:install
If the generator does not work then manually require the JS and CSS assets in your manifest files by:
//= require jquery.responsive-rater
*= require jquery.responsive-rater
In your view you can use the view helper to easily create a rater with the default options:
<%= responsive_rater_tag() %>
The helper can take a hash of options to override the defaults and customize the behavior:
This is written as a jQuery plugin and its API functions as other jQuery plugins do.
// construct a new rater inside a container, and provide some options
// available options are the same described above for the view helper, passed as an object literal
$(".rating-container").responsiveRater(options)
// get / set the value of the rater
$(".rating-container").responsiveRater("value")
$(".rating-container").responsiveRater("value", newValue)
// get / set readonly mode
$(".rating-container").responsiveRater("readonly")
$(".rating-container").responsiveRater("readonly", newValue)
// listen to an event when the rating changes
$(".rating-container").on("rated", function(value){
// do something with new value here
});
// listen to an event when the rating is reset
// reset occurs when a user clicks the highest previously rated value, e.g. clicking the 3rd star after giving a rating of 3
$(".rating-container").on("reset", function(value){
// do something with new value here
});
See the example page to see what the rater looks and functions like.
Derek Briggs - for the idea to go the responsive route in the first place, making the styles work, creating an example page, and generally being awesome.
rails-rateit - for the initial idea and some code for working around edge cases.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rails_responsive_rater demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.