Last active
September 5, 2015 09:04
-
-
Save vlado/467854 to your computer and use it in GitHub Desktop.
FormtasticExtension for MarkItUpEditor
This file contains hidden or 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 | |
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