Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 最佳位置和html安全_Css_Ruby On Rails_Overflow_Best In Place_Html Safe - Fatal编程技术网

Css 最佳位置和html安全

Css 最佳位置和html安全,css,ruby-on-rails,overflow,best-in-place,html-safe,Css,Ruby On Rails,Overflow,Best In Place,Html Safe,我正在使用rails应用程序中的来允许内联编辑。我在尝试安全地呈现一些文本html时遇到了问题 在不指定文本应为html_安全的情况下,页面上的内容如下: 我查看了最好的文档,并尝试添加以下行以使文本html安全: <div id="projectOverviewDescription"> <p> <%= best_in_place @project.overview, :description, :path => projec

我正在使用rails应用程序中的来允许内联编辑。我在尝试安全地呈现一些文本html时遇到了问题

在不指定文本应为html_安全的情况下,页面上的内容如下:

我查看了最好的文档,并尝试添加以下行以使文本html安全:

  <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>

你可以尝试这个宝石,有更多的功能,并可能解决你的问题

gem 'htmlentities'
gem 'RedCloth'
在这里找到gem文档


试试看,它会起作用的,因为我已经在我的应用程序中使用了它们,您可以在github上查看更多信息。
gem 'htmlentities'
gem 'RedCloth'