31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/formtastic-bootstrap/helpers/buttons_helper.rb', line 31
def commit_button(*args)
::ActiveSupport::Deprecation.warn("f.commit_button is deprecated in favour of f.action(:submit) and will be removed from Formtastic after 2.1. Please see ActionsHelper and InputAction or ButtonAction for more information")
options = args.
text = options.delete(:label) || args.shift
text = (localized_string(commit_button_i18n_key, text, :action, :model => commit_button_object_name) ||
Formtastic::I18n.t(commit_button_i18n_key, :model => commit_button_object_name)) unless text.is_a?(::String)
button_html = options.delete(:button_html) || {}
button_html[:id] ||= "#{@object_name}_submit"
button_html.merge!(:class => [button_html[:class], "btn commit", commit_button_i18n_key].compact.join(' '))
accesskey = (options.delete(:accesskey) || default_commit_button_accesskey) unless button_html.has_key?(:accesskey)
button_html = button_html.merge(:accesskey => accesskey) if accesskey
Formtastic::Util.html_safe(submit(text, button_html))
end
|