= simple_form_for(@<%= singular_table_name %>) do |f|
  = f.error_notification

<%- attributes.each do |attribute| -%>
  = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>

  = f.button :submit, :class => 'btn btn-primary'

= simple_form_for(@<%= singular_table_name %>) do |f|
  = f.error_notification

<%- attributes.each do |attribute| -%>
  = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>

  = f.button :submit, :class => 'btn btn-primary'

  - if @<%= singular_table_name %>.persisted?
    = link_to 'Cancel', @<%= singular_table_name %>, :class => 'btn btn-default'
  - else
    = link_to 'Cancel', <%= index_helper %>_path, :class => 'btn btn-default'


Add cancel button to scaffold form
Add cancel button to scaffold form
