Skip to content

Instantly share code, notes, and snippets.

@anathematic
Forked from nigelr/gist:5801561
Last active December 18, 2015 14:59
Show Gist options
  • Save anathematic/5801578 to your computer and use it in GitHub Desktop.
Save anathematic/5801578 to your computer and use it in GitHub Desktop.
%h1 New vendor
= render 'form'
= link_to 'Cancel', vendors_path, id: :cancel_new_vendor_link
---------------------
_form.html.haml
= form_for @vendor, :html => { :class => 'form-horizontal' } do |f|
.form-actions
= f.submit nil, :class => 'btn btn'
- if @vendor.new_record?
= link_to 'Cancel', vendors_path, id: :cancel_new_vendor_link
- else
= link_to 'Cancel', @vendor, id: :cancel_new_vendor_link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment