Created
February 22, 2010 14:35
-
-
Save dpickett/311110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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