Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 987 Bytes

README.md

File metadata and controls

45 lines (30 loc) · 987 Bytes

jQuery-DirtyForms-Rails Gem Version

Installation

Add this line to your application's Gemfile:

gem 'jquery-dirtyforms-rails'

And then execute:

$ bundle

Usage

app/assets/javascripts/application.js

//= require jquery.dirtyforms
//= require jquery.dirtyforms.dialogs.bootstrap

$(document).ready(function() {
  $("form.sodirty").dirtyForms();
});

At any erb/slim/haml view

<%= form_for :person, html: { class: "sodirty" } do |f| %>
  First name: <%= f.text_field :first_name %><br />
  Last name : <%= f.text_field :last_name %><br />
  Biography : <%= f.text_area :biography %><br />
  Admin?    : <%= f.check_box :admin %><br />
  <%= f.submit %>
<% end %>

More detail

See official readme