I'm currently utilizing the best_in_place gem within my rails application to enable inline editing functionality. However, I am encountering difficulties when attempting to display text as HTML safe.
When the text is not specified as html_safe, this is how it appears on the page:
After consulting the best_in_place documentation, I tried including the following lines in order to render the text as HTML safe:
<div id="projectOverviewDescription">
<p>
<%= best_in_place @project.overview, :description,
:path => project_step_path(@project, @project.overview),
:type => :textarea,
:nil=> "Add a description of your project here!",
:display_with => lambda { |v| v.html_safe } %>
</p>
</div>
However, the output ends up like this:
The text seems to ignore my css overflow rules, and additionally, the best_in_place editing function uses the nil placeholder ("add a description...") even when a description already exists. What is the most effective method to generate HTML safe text using best_in_place?
Below is an excerpt from my CSS:
#projectOverviewDescription{
position: absolute;
top: 0;
right: 0;
width: 250px;
padding: 20px;
float: right;
height: 236px;
border-top-right-radius: 7px;
border-bottom-right-radius: 7px;
background: $titlegrey;
opacity: 0.7;
p{
color: white;
height: 236px;
overflow-y: scroll;
overflow-x: hidden;
}
}