RTE not syncing

14 views
Skip to first unread message

Nicodemus

unread,
Dec 13, 2011, 8:37:59 AM12/13/11
to RightJS
Hi
I'm having difficulty showing the value from the db in the RTE. If I
type in the RTE and save it works fine, gets saved to the db, but
setting the value doesn't work. The saved text is there in the
textarea element but the RTE won't show it.
Here is how I configure the RTE:
textarea name="text" data-rte="{toolbar: 'extra'}"
setValue="#{@page.body}"

i also tried
textarea name="text" data-rte="{toolbar: 'extra'}"
value="#{@page.body}"

thanks for helping out.

Nikolay Nemshilov

unread,
Dec 13, 2011, 9:55:29 AM12/13/11
to rig...@googlegroups.com
Hi there,

You need to inline your html code right into the textarea, like

<textarea data-rte="{}">here is your html</textarea>

if you're on rails there is a custom helper for text areas called `rte_field`, so you can make your form kinda like that

%p
  = f.rte_field :body, toolbar: 'extra'



--
Thanks,
Nikolay

--
You received this message because you are subscribed to the Google Groups "RightJS" group.
To post to this group, send email to rig...@googlegroups.com.
To unsubscribe from this group, send email to rightjs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rightjs?hl=en.


Nicodemus

unread,
Dec 13, 2011, 10:11:41 AM12/13/11
to RightJS
Hi Nicolay
Thanks for the reply.
arg
stupid me, thanks. haven't been working with slim for very long
either.
in case anyone stumbles on this, the answer for the above is:

textarea name="text" data-rte="{toolbar: 'extra'}" =@page.body

brilliant nicolay


On Dec 13, 3:55 pm, Nikolay Nemshilov <nemshi...@gmail.com> wrote:
> Hi there,
>
> You need to inline your html code right into the textarea, like
>
> <textarea data-rte="{}">here is your html</textarea>
>
> if you're on rails there is a custom helper for text areas called `rte_field`, so you can make your form kinda like that
>
> %p
>   = f.rte_field :body, toolbar: 'extra'
>
> --
> Thanks,
> Nikolay
>
> On Dec 13, 2011, at 5:37 PM, Nicodemus wrote:
>
>
>
>
>
>
>
> > Hi
> > I'm having difficulty showing the value from the db in the RTE. If I
> > type in the RTE and save it works fine, gets saved to the db, but
> > setting the value doesn't work. The saved text is there in the
> > textarea element but the RTE won't show it.
> > Here is how I configure the RTE:
> > textarea name="text" data-rte="{toolbar: 'extra'}"

> > setValue="#...@page.body}"


>
> > i also tried
> > textarea name="text" data-rte="{toolbar: 'extra'}"

> > value="#...@page.body}"

Reply all
Reply to author
Forward
0 new messages