Skip to content

Commit

Permalink
* trying to fix seperation between 'name' and 'id'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace Suares committed Oct 3, 2011
1 parent 0b8bfe9 commit f8d6625
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/ckeditor/helpers/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ module Ckeditor
module Helpers
module ViewHelper
extend ActiveSupport::Concern

def cktext_area_tag(name, content = nil, options = {})
element_id = sanitize_to_id(name)
input_html = options.delete(:input_html) || {}
element_id = input_html.delete(:id) || sanitize_to_id(name)
input_html << { :id => element_id }

options = { :language => I18n.locale.to_s }.merge(options)
input_html = { :id => element_id }.merge( options.delete(:input_html) || {} )


output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << text_area_tag(name, content, input_html)
output_buffer << javascript_tag(Utils.js_replace(element_id, options))

output_buffer
end
end
Expand Down

0 comments on commit f8d6625

Please sign in to comment.