Skip to content

Instantly share code, notes, and snippets.

@1cg
Created March 22, 2017 22:16
Show Gist options
  • Save 1cg/67490ce6c20398f1ecfb5331ec8dbabf to your computer and use it in GitHub Desktop.
Save 1cg/67490ce6c20398f1ecfb5331ec8dbabf to your computer and use it in GitHub Desktop.
def ic_form_for(record, options = {}, &block)
ic_attribute = record.persisted? ? "ic-put-to" : "ic-post-to"
ic_html = {html: {ic_attribute => url_for(record)}}
simple_form_for(record, ic_html.merge(options), &block)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment