imacnu
imacnu

Reputation: 11

Disable_with Ruby on rails don't work

Disable_with Ruby on rails don't work

<%= f.submit "Sign In", class: "btn btn-success", data: {disable_with: " Signing in..."} %>

Upvotes: 0

Views: 282

Answers (1)

pdobb
pdobb

Reputation: 18037

The disable_with option simply not working is probably because you're missing the unobtrusive javascript driver for Rails. The easiest/best way to get this is to include the jquery-rails gem in your project.

# Gemfile
gem 'jquery-rails'

This contains the javascript that will notice the data-disable-with attribute on your submit button and make it change to the supplied value when the form is submitted.

Upvotes: 1

Related Questions