
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
realtime-validations
Advanced tools
== Introduction
RealtimeValidations is a Rails 3.1 gem that allows you to easily validate your forms. It is very easy to use, clean and yet powerful.
== Why
It is smart in the sense that is able to fulfill any kind of validation.
Also, it allows to add some information based on the current session, user, client... so the model has all the required information to perform a complete validation test.
It is very generic and is not tied to any specific case of use.
== Remember
This gem is simple. Very simple. It is developed with some things in mind:
== Dependencies
RealtimeValidations gem does not have too many dependencies:
== Installation
Installation is very easy on your own project:
=== Gemfile
gem 'realtime-validations'
=== Running generators
rails g realtime_validations:install
=== Assets pipeline
Include the core javascript of the application:
//= require realtime_validations
If you want to use the default error messages, you need to include the stylesheet too:
*= require realtime_validations
== Usage
Usage is very transparent from your project:
=== Views
You should use +form_validated_for+ instead of +form_for+ on your forms in order for them to automatically validate.
=== Error messages
You can write your own error messages handlers. There are two hooks in JQuery that will be executed in order to show and hide errors, and that can be found commented out on the JS file installed by the generator.
RealtimeValidations.showErrors = function(field, errors) { }
RealtimeValidations.hideErrors = function(field) { }
There is a default implementation for both, and you can use that one if you want. If you need a more personalized error reporting or more sophisticated you will have to code your own. :)
FAQs
Unknown package
We found that realtime-validations 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.