Rails Tiny Mce text_area params为空

时间:2011-04-28 06:28:58

标签: ruby-on-rails ruby ruby-on-rails-3 tinymce

正如您在我的rails log中看到的那样,我的text_area文本为空:

Started POST "/admin/tags/3" for 127.0.0.1 at 2011-04-28 08:24:39 +0200
  Processing by Admin::TagsController#update as HTML
  Parameters: {"utf8"=>"Ô£ô", "authenticity_token"=>"X9LoKGw2OXE/rXBor7YxEKJmxpe
BM0hq+u7q1NiPbtE=", "tag"=>{"name"=>"vind billetter", "title"=>"Vind billetter Ô
Çô Deltag i konkurrencer om billetter", "keywords"=>"", "meta"=>"", "h1"=>"Vind
billetter ÔÇô Deltag i konkurrencer om billetter", "text"=>""}, "commit"=>"Updat
e Tag", "id"=>"3"}
  ←[1m←[36mKonkurrancer Load (0.0ms)←[0m  ←[1mSELECT `konkurrancers`.* FROM `kon
kurrancers`←[0m
  ←[1m←[35mCACHE (0.0ms)←[0m  SELECT `konkurrancers`.* FROM `konkurrancers`
  ←[1m←[36mCACHE (0.0ms)←[0m  ←[1mSELECT `konkurrancers`.* FROM `konkurrancers`←
[0m
  ←[1m←[35mTag Load (0.0ms)←[0m  SELECT `tags`.* FROM `tags`
  ←[1m←[36mAdmin Load (1.0ms)←[0m  ←[1mSELECT `admins`.* FROM `admins` WHERE (`a
dmins`.`id` = 1) LIMIT 1←[0m
  ←[1m←[35mTag Load (0.0ms)←[0m  SELECT `tags`.* FROM `tags` WHERE (`tags`.`cach
ed_slug` = '3') LIMIT 1
  ←[1m←[36mSQL (0.0ms)←[0m  ←[1mSELECT sluggable_id FROM slugs WHERE ((slugs.slu
ggable_type = 'Tag' AND slugs.name = '3' AND slugs.sequence = 1))←[0m
  ←[1m←[35mTag Load (0.0ms)←[0m  SELECT `tags`.* FROM `tags` WHERE (`tags`.`id`
= 3) LIMIT 1
  ←[1m←[36mSQL (0.0ms)←[0m  ←[1mBEGIN←[0m
  ←[1m←[35mSlug Load (1.0ms)←[0m  SELECT `slugs`.* FROM `slugs` WHERE (`slugs`.s
luggable_id = 3 AND `slugs`.sluggable_type = 'Tag') ORDER BY id DESC LIMIT 1
  ←[1m←[36mSQL (0.0ms)←[0m  ←[1mCOMMIT←[0m
Redirected to http://localhost:3000/admin/kategoris/3
Completed 302 Found in 207ms

我的表格:

    <%= simple_form_for(@kategori, :url => {:action => 'update', :id => @kategori.id }) do |f| %>
<%= f.text_area :text, :cols => 80, :rows => 20, :class => 'mceEditor' %>
    <%= f.button :submit %>
    <% end %>

我的tiny_mce.yml:

# Here you can specify default options for TinyMCE across all controller
theme: advanced
editor_selector: tinyMce
plugins:
 - layer
 - save
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top"
        theme_advanced_toolbar_align : "left"
        theme_advanced_statusbar_location : "bottom"
        theme_advanced_resizing : true

我的applikation控制器:

uses_tiny_mce(:options => {  :theme => 'advanced', :theme_advanced_toolbar_location => "top", :theme_advanced_toolbar_align => "left", :editor_selector => "mceEditor", :skin => 'o2k7', :skin_variant => 'silver', :theme_advanced_resizing => true, :theme_advanced_statusbar_location => "bottom"})

我的代码控制器:

uses_tiny_mce :options => {  :theme => 'simple'}

更新和创建操作

中未提交text_area文本

2 个答案:

答案 0 :(得分:0)

这个问题/答案似乎也适用于您的问题 - 请查看:TinyMCE not sending value

如果这没有帮助 - 请告诉我。

答案 1 :(得分:0)

我找到了一个解决方案,我在管理员控制器中删除了tiny_mce配置