Skip to content

Instantly share code, notes, and snippets.

@vlado
Last active September 5, 2015 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vlado/467854 to your computer and use it in GitHub Desktop.
Save vlado/467854 to your computer and use it in GitHub Desktop.
FormtasticExtension for MarkItUpEditor
module FormtasticExtensions
module Formtastic
module MarkItUpEditor
def self.included(base)
base.class_eval do
@mark_it_up_dependencies_included = false
end
end
protected
def mark_it_up_input(method, options = {})
output = text_input(method, options)
dom_id = "#{@object_name}_#{method}"
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