4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/optimacms/simple_form_extensions/button_components.rb', line 4
def submit_cancel(*args, &block)
template.content_tag :div, :class => "form-group" do
template.content_tag :div, :class => "col-sm-offset-1 col-sm-6" do
options = args.
options[:class] = [options[:class], 'btn', 'btn-primary', 'btn-lg'].compact
args << options
if cancel = options.delete(:cancel)
submit(*args, &block) + ' '.html_safe + template.link_to(I18n.t('simple_form.buttons.cancel'), cancel)
else
submit(*args, &block)
end
end
end
end
|