Ruby on rails CKeditor不显示格式化代码

Ruby on rails CKeditor不显示格式化代码,ruby-on-rails,ckeditor,Ruby On Rails,Ckeditor,我已经为我的Rails应用程序安装了CKeditor,在进行格式化时,格式化的代码不会显示在屏幕上,而是呈现HTML,如下所示 <h2><strong>In this project</strong> you&rsquo;ll create a simple blog system and learn the basics of Ruby on Rails including: Models, Views, and Controllers (MVC)

我已经为我的Rails应用程序安装了CKeditor,在进行格式化时,格式化的代码不会显示在屏幕上,而是呈现HTML,如下所示

<h2><strong>In this project</strong> you&rsquo;ll create a simple blog system and learn the basics of Ruby on Rails including: Models, Views, and Controllers (MVC) Data Structures &amp; Relationships Routing Migrations Views with forms, partials, and helpers RESTful design Using Rails plugins/gems The project will be developed in five iterations. I0: Up and Running Part of the reason Ruby on Rails became popular quickly is that it takes a lot of the hard work off your hands, and that&rsquo;s especially true in starting up a project. Rails practices the idea of &quot;sensible defaults&quot; and will, with one command, create a working application ready for your customization. Setting the Stage First we need to make sure everything is set up and installed. See the Environment Setup page for instructions on setting up and verifying your Ruby, Rails, and add-ons. This tutorial was created with Rails 4.0.0, and may need slight adaptations for other versions of Rails. Let us know if you find something strange! From the command line, switch to the folder that will store your projects. For instance, I use /Users/jcasimir/projects/. Within that folder, run the rails command:</h2>
在本项目中您;我将创建一个简单的博客系统,学习RubyonRails的基础知识,包括:模型、视图和控制器(MVC)数据结构&;关系路由迁移视图与表单、partials和helpers使用Rails插件/gems进行RESTful设计项目将在五次迭代中开发。I0:Ruby on Rails之所以迅速流行,部分原因在于它可以让您免去很多繁重的工作,而这正是;在启动一个项目时尤其如此。Rails实践“合理默认值”的思想,只需一个命令,就可以创建一个可供定制的工作应用程序。首先设置阶段,我们需要确保所有内容都已设置和安装。有关设置和验证Ruby、Rails和add-ons的说明,请参见环境设置页面。本教程是使用Rails 4.0.0创建的,可能需要对Rails的其他版本稍作修改。如果你发现什么奇怪的事情,请告诉我们!从命令行切换到将存储项目的文件夹。例如,我使用/Users/jcasimir/projects/。在该文件夹中,运行rails命令:

使用
html\u-safe
方法

比如说:

puts my_variable.html_safe
更多信息请点击此处: