Sha256: 5aef3e0a42d1adca1840e9c0758ca12b4bd4d57bd8ccba2e65ec79ec6f8f7f41

Contents?: true

Size: 587 Bytes

Versions: 3

Compression:

Stored size: 587 Bytes

Contents

module RedactorRails
  module Helpers
    def redactor(options={})
      javascript_tag { redactor_javascript(options) }
    end

    # Returns the JavaScript code required to initialize RedactorRailsjs.
    def redactor_javascript(options={})
      configuration = RedactorRails.configuration.merge(options)
      "$(document).ready(function(){$('.redactor').redactor(#{configuration.options_for_redactor.to_json});});".html_safe
    end
    # Setting Redactor Language
    def redactor_lang(lang = 'en')
      javascript_include_tag "redactor-rails/langs/#{lang}.js"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
redactor-rails-0.2.5 lib/redactor-rails/helper.rb
redactor-rails-0.2.4 lib/redactor-rails/helper.rb
redactor-rails-0.2.3 lib/redactor-rails/helper.rb