Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

etandrib-livevalidation

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

etandrib-livevalidation

  • 1.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

LiveValidation is a plugin which allows automatic integration of your Rails application with Javascript library LiveValidation[http://www.livevalidation.com/]. This library implements client-side form validation and you can see a demo in its site.

This plugin generates the needed Javascript code to run client-side the validations you have already defined in your models (with Rails validation helpers) to run them server-side, and redefines form helpers to automaticaly include that Javascript code. You have not to write your validations twice so you can keep DRY. And if you have 1) used Rails validation helpers to validate your models, and 2) used Rails form helpers to create your forms, you only have to install this plugin to get your forms validated both server and client-side!

== A little HOWTO

  1. Install the plugin or the gem dependency:

    script/plugin install git://github.com/etandrib/livevalidation.git
    OR

    In environment.rb

    config.gem "livevalidation", :lib => "etandrib/livevalidation", :version => ">= 1.3.0", :source => "http://gems.github.com"

  2. Use the rake task to install the Javascript and CSS files in the public folder

    rake livevalidation:install

  3. Modify your application header to include at least the Prototype and LiveValidation Javascript libraries. Also add the LiveValidation stylesheet.

    <%= javascript_include_tag 'prototype', 'live_validation' %> <%= stylesheet_link_tag 'live_validation' %>

  4. Enjoy! You can know use the default Rails form helpers and validation methods which will automatically call on the LiveValidation scripts and styles.

You can disable live validation for a given field using :live => false:

<%= f.text_field :name, :live => false %>

You can also reverse this schema so the default is no validation by including the following in your config/environment.rb:

ActionView::live_validations = false
	

and enabling it only for some fields:

<%= f.text_field :name, :live => true %>

== Supported validations

  • validates_presence_of
  • validates_numericallity_of
  • validates_format_of
  • validates_length_of
  • validates_confirmation_of

== Supported form helpers

  • text_field
  • text_area
  • password_field

== Author

Gemification by {Nate Bird}[http://etandrib.github.com]. Plugin written by {Sergio Gil}[http://www.lacoctelera.com/porras]. The LiveValidation library is maintained by {Alec Hill}[http://www.livevalidation.com].

== License

LiveValidation is licensed under the terms of the {MIT License}[http://www.opensource.org/licenses/mit-license.php].

Copyright (c) 2007 Sergio Gil

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc