-
-
Save ktec/467980 to your computer and use it in GitHub Desktop.
added markitup viewhelpers and force output to a string
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 FormtasticExtensions | |
module Formtastic | |
module MarkItUpEditor | |
include MarkItUp::ViewHelpers | |
def self.included(base) | |
base.class_eval do | |
@mark_it_up_dependencies_included = false | |
end | |
end | |
protected | |
def mark_it_up_input(method, options = {}) | |
dom_id = "#{@object_name}_#{method}" | |
output = '' | |
output << text_input(method, options) | |
output << mark_it_up(dom_id, options[:mark_it_up], @mark_it_up_dependencies_included) | |
end | |
end | |
end | |
end | |
if Object.const_defined?("Formtastic") | |
Formtastic::SemanticFormBuilder.send(:include, FormtasticExtensions::Formtastic::MarkItUpEditor) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding output='' prevents the output being escaped by formtastic