L
L
lavezzi12015-03-17 21:02:00
Ruby on Rails
lavezzi1, 2015-03-17 21:02:00

I can't connect redactor-rails, what's wrong?

Install this gem https://github.com/SammyLin/redactor-rails
Everything is going well up to this point:
For each textarea that you want to use with Redactor, add the "redactor" class and ensure it has a unique ID:

<%= text_area_tag :editor, "", :class => "redactor", :rows => 40, :cols => 120 %>

The line responsible for entering text I have the following Tried -<%= f.text_field :body %><br>
<%= f.text_field :body, :class => "redactor" %><br>

The editor is visible, but does not format. And if you completely insert the original line from the documentation, then it does not create a post, because the fields are not filled, namely the body.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Bondarenko, 2015-03-27
@bondarenko

Most likely, the fact is that the editor works with textarea, and

<%= f.text_field :body, :class => "redactor" %><br>
returns normal input
try
<%= f.text_area :body, :class => "redactor" %>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question