I am using ckeditor for rails 3 and I have it set up already in form, works nice except the view part, when I go to the model show page I tags that I used for text formatting but there is no bold font or any other modifications I did to the text. Where is the problem? Do I have to put something next to the field that is rendering this text like I did in form?
code for form that works just fine
<div class="field">
<%= f.cktext_area :comments, :cols => 80, :rows => 20 %>
</div>
and in show.html.erb
<p style="margin-left:5px;text-align:justify;padding:5px;"><%= @car.comments %></p>
<p> <em>The 2011 Cadillac Escalade ranks 1 out of 9 Luxury Large SUVs. This ranking is
based on our analysis of 86 published reviews and test drives of the Cadillac Escalade, and
our analysis of reliability and safety data.The 2011 Cadillac Escalade is not for shrinking
violets. It’s an SUV for buyers who like to be noticed, but who also need the
capabilities of a full-sized truck-based SUV – and are willing to pay to get them.
</em>
That is the result, as you see there are tags around the text but they are escaped. Thanks for your time.
OK. I got it. I just needed the raw before the field. for example <%= [email protected] %>
or
<%= raw(car.comments) %>
depending where you need them. Thanks to Google :).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With