Ruby on Rails 中的 CKeditor

发布于 2024-12-25 00:34:27 字数 721 浏览 1 评论 0原文

我按照 此存储库中的说明安装了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

却一份温柔 2025-01-01 00:34:27

嘿,首先我也遇到了这个错误,然后当我重新启动服务器时,一切正常。
尝试一下。希望它能发挥作用。

Hey first I also got this error and then when i restarted the server everything worked fine.
Try it.Hope it gets working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文