Ruby on Rails 中的 CKeditor
我按照 此存储库中的说明安装了 Ckeditor
我创建了一个简单的 Rails 应用程序,添加了
gem 'ckeditor'
到 Gemfile,然后从命令行运行 bundle install
。
我创建了一个只有一个文本字段的脚手架。我想在创建/更新操作中使用 cktext_area 而不是普通的 text_area。
但是,
我会收到此错误undefined method 'cktext_area' for #
替换表单文本区域,
如果我用此<%= javascript_include_tag :ckeditor %> <%= f.cktext_area :name%>
我按照 github 中编写的方式运行了安装,似乎无法找到合适的帮助程序。即使我尝试插入 cktext_area_tag("test_area", "Ckeditor") 它也无法找到正确的助手。
我正在使用 Rails 3.1.3
I installed Ckeditor following the instruction in this repository
I created a simple rails application adding
gem 'ckeditor'
to the Gemfile and then running bundle install
from command line.
I created a scaffold with only one text field. I wanted to have a cktext_area rather than a normal text_area in the create/update action.
However, I get this error
undefined method 'cktext_area' for #<ActionView::Helpers::FormBuilder:0xb66fe5a8>
if I substitute the form text area with this
<%= javascript_include_tag :ckeditor %>
<%= f.cktext_area :name%>
I ran the installation as written in github, it seems it isn't able to find the appropriate helper. Even if I try to insert cktext_area_tag("test_area", "Ckeditor")
it isn't able to find the correct helper.
I'm using Rails 3.1.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘿,首先我也遇到了这个错误,然后当我重新启动服务器时,一切正常。
尝试一下。希望它能发挥作用。
Hey first I also got this error and then when i restarted the server everything worked fine.
Try it.Hope it gets working.