32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/bootstrap_form_extensions/submit_bar.rb', line 32
def submit_bar show_submit_button: @@show_submit_button, submit_button_text: @@submit_button_text,
show_submit_menu: @@show_submit_menu, show_submit_and_dup_button: @@show_submit_and_dup_button, show_submit_and_new_button: @@show_submit_and_new_button,
show_cancel_button: @@show_cancel_button, cancel_button_text: nil, cancel_button_url: nil,
extra_buttons: [], right_buttons: [],
partial: @@partial
&&= @template.current_ability.can? :new, object if @template.respond_to? :current_ability
cancel_button_url ||= @template.url_for(object.persisted? ? object : @template.controller_name.to_sym) rescue 'javascript:history.back();'
cancel_button_text ||= show_submit_button ? @@cancel_button_text : @@back_button_text
@template.render partial, {
show_submit_button: show_submit_button, submit_button_text: submit_button_text,
show_submit_menu: , show_submit_and_dup_button: show_submit_and_dup_button, show_submit_and_new_button: show_submit_and_new_button,
show_cancel_button: show_cancel_button, cancel_button_text: cancel_button_text, cancel_button_url: cancel_button_url,
extra_buttons: (, :extra),
right_buttons: (right_buttons, :right),
}
end
|