Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
FormBuilderWithCancel < Formtastic::SemanticFormBuilder
# - f.buttons do
# = f.commit_button
# = f.cancel
# Need to make this v2 like by using module...
class FormBuilderWithCancel < Formtastic::SemanticFormBuilder
def cancel(*args)
options = args.extract_options!
options[:class] ||= "cancel"
options[:label] ||= (args.shift || "Cancel")
options[:return_to] ||= :back
template.content_tag(:li, template.link_to(options[:label], options[:return_to]), :class => options[:class])
Formtastic::SemanticFormHelper.builder = FormBuilderWithCancel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.