Sha256: 4c569ed142a237fc487aec1d4a6ac5d781fb4be841b176b33ab2e71aecfa0eb2
Contents?: true
Size: 566 Bytes
Versions: 2
Compression:
Stored size: 566 Bytes
Contents
require 'erb' module Quill module Rails module ViewHelpers def source_root File.dirname(__FILE__) + '/templates' end # A link helper to create a 'default' Quill text edit # def quill_editor(name=nil, options={}) mod_options = { name: 'quill-value', id: 'quill-value' }.merge options @input_name = (name || mod_options[:name]) @input_id = (name || mod_options[:id]) ERB.new(File.read(File.join(source_root, 'template.html.erb'))).result(binding).html_safe end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
quill-rails-0.1.3 | lib/quill/rails/view_helpers.rb |
quill-rails-0.1.2 | lib/quill/rails/view_helpers.rb |