Giter VIP home page Giter VIP logo

client_side_validations-simple_form's Introduction

ClientSideValidations-SimpleForm for Rails 4.0#

SimpleForm plugin for ClientSideValidations

Installation

In your Gemfile add the following:

gem 'simple_form'
gem 'client_side_validations', github: 'coorasse/client_side_validations', branch: '4-0-beta'
gem 'client_side_validations-simple_form', github: 'coorasse/client_side_validations-simple_form'

Order matters here. SimpleForm and ClientSideValidations need to be required before ClientSideValidations-SimpleForm.

Follow the remaining installation instructions for ClientSideValidations

Add the following line to app/assets/javascripts/application.js

//= require rails.validations.simple_form

Again, order matters. You should add this line after the require for rails.validations as described in the ClientSideValidations installation instructions.

If the asset pipeline is disabled the asset file will be copied into public/javascripts when the ClientSideValidations install generator is run.

At any time you can copy the asset file into your project by running:

rails g client_side_validations:copy_assets

If the asset pipeline is disabled the asset file will be copied into public/javascripts. Otherwise the asset file will be copied into app/assets/javascripts (or whatever asset directory you have defined)

Wrappers

Supports default, bootstrap and foundation wrappers.

Usage

The usage is the same as ClientSideValidations, just pass :validate => true to the form builder

<%= simple_form_for @book, :validate => true do |book| %>
  <%= book.input :name %>
<% end %>

Per-input options are done with :validate

<%= book.input :name, :validate => { :presence => true, :uniqueness => false }

Authors

Brian Cardarella

We are very thankful for the many contributors

Versioning

This gem follows Semantic Versioning

Major and minor version numbers will follow Rails's major and minor version numbers. For example, client_side_validations-simple_form-2.0.0 will be compatible up to ~> simple_form-2.0.0

Want to help?

Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.

Legal

DockYard, LLC © 2012

@dockyard

Licensed under the MIT license

client_side_validations-simple_form's People

Contributors

bcardarella avatar coorasse avatar danryan avatar jordanbrock avatar sdesbure avatar basitshaikh avatar duggiefresh avatar fgrehm avatar felixbuenemann avatar ansel1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.