验证字段并使用tinyMce保存

时间:2013-08-06 12:47:01

标签: ruby-on-rails

大家好我在rails中有_form,这很有效。

我必须在一个领域中包含一个TinyMce,我现在就拥有它......

= form_for @idea do |f|
  - if @idea.errors.any?
    #error_explanation
      %h2= "#{pluralize(@idea.errors.count, "error")} prohibited this idea from being saved:"
      %ul
        - @idea.errors.full_messages.each do |msg|
          %li= msg

  .field
    = f.label :name
    = f.text_field :name, :required => true
  .field
    = f.label :description
    = f.text_area :description,  :class => "tinymce", :cols=>"25", :rows=>"5", :required => true
    = tinymce

现在的问题,如果我使用required =>是的,并且使用tinymce选项不保存表单,因为表单认为此字段为空,但不显示任何错误,也不保存。

任何想法,

0 个答案:

没有答案