lib/lalala/markdown/input_helper.rb in lalala-4.1.0.dev.356 vs lib/lalala/markdown/input_helper.rb in lalala-4.1.0.dev.358
- old
+ new
@@ -1,12 +1,20 @@
module Lalala::Markdown::InputHelper
extend ActiveSupport::Concern
def input(method, options = {})
+ if @object.respond_to?("#{method}_html")
+ options = options.dup.clone
- if ( @object.respond_to?("#{method}_html") )
input_html = options[:input_html] || {}
input_html[:class] = [input_html[:class], 'markdown'].flatten.compact.join(" ")
+
+ editor_options = options[:editor_options] || {}
+ editor_options.each do |k, v|
+ v = if v === true then "1" elsif v === false then "0" end
+ input_html["editor-#{k.to_s.gsub("_", "-")}"] = v
+ end
+
options[:input_html] = input_html
end
super(method, options)
end