forms - redactor rails can't use with simple_form -
i install gem 'redactor-rails', it's text editor. want use simple_form, have trouble.
if use standart rails helper form_for:
<%= form_for(@profile) |f| %> <%= f.text_area :aboutme, placeholder: "content goes here...", :class => "redactor"%> <% end %>
it's right. can edit text bold, italic , etc.
but when try use simple_form:
<%= simple_form_for(@profile) |f| %> <%= render 'devise/shared/error_messages', object: f.object %> <%= f.input :aboutme, input_html: { class: "redactor", as: :text } %> <%= text_area_tag :editor, "ghbtd", :class => "redactor", :rows => 40, :cols => 120 %> <%= f.submit "Сохранить", class: "btn btn-primary" %> <% end %>
i add text_area_tag usual form, it's create 2 fields, 1 field(with text_area_tag) it's works good, redactors field created simple_form become simple field, can't modify it's redactors, can input text, , have width other fields in form, text_area_tag it's have bigger width. as:text attribute should create field how text_area in simple_form, why doesn't work?
for people still facing kind of problem, above problem this-
<%= simple_form_for(@profile) |f| %> <%= f.input :aboutme, label: 'your label', :as => :text, :input_html => { :class => "redactor" } %> <%= f.submit "Сохранить", class: "btn btn-primary" %> <% end %>
Comments
Post a Comment