Using TinyMCE with SimpleForm

388 views
Skip to first unread message

Konstantinos Pachnis

unread,
Apr 1, 2011, 12:26:17 PM4/1/11
to SimpleForm
Hi,

I am trying to use simple_form with TinyMCE using the tiny_mce gem,
but unfortunately I am unable to submit the form.

This is the snippet from the view code

<%= perk_form.input :description, :input_html => { :class =>
'mceEditor' } %>

The generated html for this creates the text_area and shows TinyMCE
but the its class value is "text required mceEditor", the result is
that the form can not be posted.

If I change the code to

<%= perk_form.text_area :description, :class => 'mceEditor' %>

it works, but the TinyMCE is not validated with simple_form.

Any thoughts how I could overcome this would be really appreciated.

Thanks in advance,
Konstantinos




Carlos Antonio da Silva

unread,
Apr 1, 2011, 12:33:48 PM4/1/11
to plataformate...@googlegroups.com, Konstantinos Pachnis
You are doing it right, this is the way to do it:

<%= perk_form.input :description, :input_html => { :class =>
'mceEditor' } %>

The required option being added to the text area may be toe problem, if you're using Chrome for instance it'd validate and not allow you to post the form without informing a value in this field.
If that's what is going on with you, there is some more info here: https://github.com/plataformatec/simple_form/wiki/HTML5-Attributes
--
At.
Carlos A. da Silva

Konstantinos Pachnis

unread,
Apr 1, 2011, 12:38:21 PM4/1/11
to Carlos Antonio da Silva, plataformate...@googlegroups.com
Hi Carlos,

That did the trick.

Thanks a lot for your help.

Cheers,
Konstantinos
Reply all
Reply to author
Forward
0 new messages