Macrow / rails_kindeditor

Kindeditor for Ruby on Rails
260 stars 108 forks source link

id not work for kindeditor_tag #101

Open dreamable opened 6 years ago

dreamable commented 6 years ago

If we want to specify id instead of the default one from name, it won't work on the js part. For example <%= kindeditor_tag "name", value, input_html: {id: "my_id"} %> In the generate html, the id for text_area is "my_id", but the js, it still use the default id "#name".

The fix should be in the rails_kindeditor/lib/rails_kindeditor/helper.rb file, change line 9 to output << javascript_tag(js_replace(input_html[:id], options))