I recently started testing web_app_theme plugin. In Create button I have something like this…
<button class="button" type="submit">
<%= image_tag("web-app-theme/icons/tick.png", :alt => "#{t("web-app-theme.save", :default => "Save")}") %> <%= t("web-app-theme.save", :default => "Save") %>
</button>
How can I add :disable_with => "Processing" to this button to prevent duplicate records?
I tried t("web-app-theme.save", :default => "Save"), :disable_with => "Processing", but of course, that didn’t work.
You need to use form tag helper methods – something like this should do it:
Here’s a link to the API docs for the
button_tomethod: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_toUpdated Dec 14, 2013 for Rails 3.2 & 4 syntax.