Rails 新手求助 怎么保存 html 代码到数据库

secondrocker · 2012年10月25日 · 最后由 yangman_wenzhu 回复于 2012年11月02日 · 2733 次阅读

使用 kindeditor,按照说明,别的没问题,但保存时保存不了, log 日志如下

tarted POST "/articles" for 127.0.0.1 at 2012-10-25 22:36:27 +0800 Processing by ArticlesController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"2sr+RFvJbtF19DnMkKMNieOjaIY6Mq+Hg3TvpBraBUw=", "article"=>{"title"=>"Dream undead,keep on fighting"}, "content"=>"    千古路不转,后顾路也不转,什么玩意 思密达 所覆盖忽然他孙刚峰二个热人多高的贵的跌入谷底如果打工的人他如果热贴个", "commit"=>"Create Article"} (0.2ms) BEGIN SQL (3.3ms) INSERT INTO articles (content, created_at, title, updated_at, user_id) VALUES (NULL, '2012-10-25 14:36:27', 'Dream undead,keep on fighting', '2012-10-25 14:36:27', NULL) (1.3ms) COMMIT Redirected to http://0.0.0.0:3000/articles/1 Completed 302 Found in 47ms (ActiveRecord: 4.7ms)

rails 的版本时 3.28

html 代码貌似被滤掉了,需要咋弄啊?

你的 content 沒包到 article,把 form 的代碼放上來瞧瞧!

#1 楼 @hellolucky123 谢谢你啦,真是太 2 了,没把 kindeditor 包进去...,老以为是安全机制给挡住了...

这个用的是插件呢,怎么做的呢最后?

需要 登录 后方可回复, 如果你还没有账号请 注册新账号