Julius Dzidzevičius
Julius Dzidzevičius

Reputation: 11000

button_to disabled: true doesn't work

Maybe I misunderstood something..?

button_to signature:

button_to(name = nil, options = nil, html_options = nil, &block)

My button:

<%= button_to "Re-send pin", {action: "send_pin_again", :disabled => true} %>

is still enabled..

Upvotes: 0

Views: 2325

Answers (1)

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230471

Maybe I misunderstood something

Yes, disabled is an html attribute.

There are a few special html_options:

...

:disabled - If set to true, it will generate a disabled button.

Place it in the corresponding argument.

 <%= button_to "Re-send pin", {action: "send_pin_again"}, :disabled => true %>

Upvotes: 2

Related Questions