Add this line to your application's Gemfile:
gem 'jquery-dirtyforms-rails'
And then execute:
$ bundle
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 %>
See official readme