Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created February 22, 2010 14:35
Show Gist options
  • Save dpickett/311110 to your computer and use it in GitHub Desktop.
Save dpickett/311110 to your computer and use it in GitHub Desktop.
module Liquid
module Tags
class ContactInquiryForm < Liquid::Tag
def self.helper_method(method)
end
def request_forgery_protection_token
:authenticity_token
end
def protect_against_forgery?
false
end
class_inheritable_accessor :allow_forgery_protection
self.allow_forgery_protection = false
attr_accessor :output_buffer
include ActionView::Helpers::FormHelper
include ActionView::Helpers::FormTagHelper
include ActionView::Helpers::FormOptionsHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::ActiveRecordHelper
include ActionView::Helpers::RecordIdentificationHelper
include ActionView::Helpers::DateHelper
include ActionView::Helpers::CaptureHelper
include ActiveSupport
include ActionController::PolymorphicRoutes
include Formtastic::SemanticFormHelper
def render(context)
@output_buffer = ""
test = semantic_form_for(context.scopes[0]["contact_inquiry"],
:url => '/contact_inquiries') do |f|
f.inputs do
concat(f.input :email)
concat(f.input :subject)
concat(f.input :message)
end
f.buttons do
concat(f.commit_button "Send")
end
end
output_buffer
end
end
end
end
Liquid::Template.register_tag('contact_form', Liquid::Tags::ContactInquiryForm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment