Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Beautiful Rails confirm dialogs with ZURB Foundation
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
vendor/assets/javascripts
.gitignore
Gemfile
LICENSE
README.md
Rakefile
foundation_rails_confirm.gemspec

README.md

Unmaintained!

I'm not updating this repository anymore, please check out https://github.com/agoragames/confirm-with-reveal for an alternative solution.

Foundation Rails Confirm

This gem adds some javascript to change the default behaviour of data-confirm processing. It is inspired by https://github.com/bluerail/twitter-bootstrap-rails-confirm.

Installation

Add to Gemfile:

gem 'foundation_rails_confirm'

Add it to your application.js:

//= require foundation-rails-confirm

Usage

Your existing confirm dialogs will automatically use this library.

To pass more information you can use these new options:

  • data-confirm-title (default: window.top.location.origin)
  • data-confirm-cancel (default: 'cancel')
  • data-confirm-proceed (default: 'ok')
  • data-confirm-proceed-class (default: 'proceed')

Usage Example:

link_to t('.destroy'), some_item_path,
  :method => :delete,
  :class => "button",
  :confirm => t('.destroy_confirm.body', :item => options[:item]),
  "data-confirm-title" => t('.destroy_confirm.title', :item => options[:item]),
  "data-confirm-cancel" => t('.destroy_confirm.cancel', :item => options[:item]),
  "data-confirm-proceed" => t('.destroy_confirm.proceed', :item => options[:item]),
  "data-confirm-proceed-class" => "alert"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.