Method: TbCore::FormBuilder#tb_save_buttons
- Defined in:
- lib/tb_core/form_builder.rb
#tb_save_buttons(model_name, cancel_path, delete_path = nil) ⇒ Object
Builds a row of save/cancel buttons
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/tb_core/form_builder.rb', line 120 def (model_name, cancel_path, delete_path=nil) content_tag :div, class: 'form-group' do content_tag :div, class: 'col-sm-offset-2 col-sm-10' do concat submit "Save #{model_name}", class: 'btn btn-primary', data: { disable_with: "Saving #{model_name}...", enable_with: 'Saved!' } concat ' ' concat @template.link_to 'Cancel', cancel_path, class: 'btn btn-default', data: {dismiss: :modal} if delete_path != nil concat ' ' concat @template.link_to 'Delete', delete_path, class: 'btn btn-danger', data: {confirm: "This action can't be undone. Would you like to delete the #{model_name.downcase}?"}, method: :delete end end end end |