WYSIWYG Editors and Rails

Hi everyone,

I’m currently investigating re-writing our School CMS application in
Rails and the only drawback I can see is there isn’t an ample supply (if
any) of WYSIWYG In-browser editors written with a raw Ruby backend. We
currently use KTML4 which is written with PHP as a base. I’m interested
to hear from anyone who’s integrated a PHP based editor into a rails
application and how you interfaced between the two. KTML4 does have
manual integration instructions for how to insert it into the many OS
CMS system’s out there so there is some doco available.

Also, if there is something better out there written in Ruby I’d love to
hear about it :slight_smile:

Cheers,

Brendon M.

I would rather recommend a markup language like BlueCloth.
WYSIWYG editors are simply not good enough and leave way too much room
for mistakes. And a messy code that has a great danger of destroying
the look and feel of the page in the wrong hands.
I like Typos solution of using BlueCloth and then a live preview that
is automatically refreshed.

On 5/29/06, Brendon M. [email protected] wrote:

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

You could just try a plain old JavaScript editor. That sort of thing
doesn’t actually require any server-side stuff if you think about it.
Just so long as it’s made to support all browsers. TinyMCE should do
the job:

-N

The best one from a point of maintaining markup quality is the dojo
editor, since you can nail down exactly what the user can or cannot
do. There were a few issues involved in integrating with rails but I
believe that this has been sorted now, at least in the latest
revisions.

Check on the dojo list for more details, there’s definitely been a few
people there with some experiece of integration.

Ross

Oh, of course, you will need your own validation using regular
expressions to make sure that no-ones sent tags their not allowed to.
Just basically one to match all b, i, u and whatever other tags you
want to give the option of, and strip out anything else which looks
like a tag.
-N

On May 28, 2006, at 9:08 PM, Brendon M. wrote:

manual integration instructions for how to insert it into the many OS
CMS system’s out there so there is some doco available.

Also, if there is something better out there written in Ruby I’d
love to
hear about it :slight_smile:

TinyMCE and the FCK editor work fine with a ruby back end (both work
okay out of the box). If you want to add more sophisticated stuff
down the road, and if I were you I’d be assuming that will be the
case no matter what you think now :slight_smile: then you’ll have to implement
some back-end stuff in ruby. This isn’t hard for either editor so
don’t worry about it.

I’ve used both and I prefer TinyMCE but I know perfectly reasonable
people who prefer FCK.

The Dojo editor looks very promising, but the last time I looked it
wasn’t competitive with either tinyMCE or FCK. It is worth watching.

There is also, apparently, an editor that is part of the OpenLaszlo
system but I have not used it.

Cheers,
Bob

http://lists.rubyonrails.org/mailman/listinfo/rails


Bob H. – blogs at <http://www.recursive.ca/
hutch/>
Recursive Design Inc. – http://www.recursive.ca/
Raconteur – http://www.raconteur.info/
xampl for Ruby – http://rubyforge.org/projects/xampl/

I have just got FCKEditor to work under Rails. So far I am quite
impressed. I needed an editor which allowed me to upload images using
the same interface. FCK does this quite nicely.

Luckily Michael Moen had already made some code that enabled the FCK
file upload interface to work with Rails. Here is the link :

http://www.underpantsgnome.com/projects/fckeditor-on-rails/

I hope this helps

Kind Regards
Hamza

Check on the dojo list for more details, there’s definitely been a few
people there with some experiece of integration.

+1 on the Dojo Editor

See

http://blog.innerewut.de/articles/2006/05/22/dojo-and-rails-or-better-dojo-and-the-base-relative-path

Jonathan

Thanks everyone for your suggestions :slight_smile: I forgot enable email
notification and forgot about the post :slight_smile: I will look into the features
of these editors. I like KTML4’s file browser and the ability to upload
as many files as you want at one time using a regular file browsing
window (ctrl + click type selection). Plus it has a built in image
editor!

With regards to using BlueCloth (which I haven’t actually looked at yet

  • but will), I’m basically selling this software to schools and the
    users usually have absolutely no idea about what they’re actually doing
    in the background (When making a page). And that’s the way it’s supposed
    to be, or they wouldn’t have a reason to buy it! :slight_smile:

Another editor that I have been particularly impressed with (but we
dropped them because they didn’t keep up with the bleeding edge of
features) was InnovaStudio. Their editor has the most polished interface
that I’ve ever seen and acted the most like the evil office applications
that we love to hate (end users love this). So I just thought I’d put
that out there :slight_smile:

Cheers,

Brendon

Heh good timing on this discussion.

I wrote and released a Rails plugin for integrating TinyMCE into
Rails applications in roughly 3 lines of code. My friend John W.
blogged a tutorial about how to utilize it last week:

http://johnwulff.com/articles/2006/05/31/tinymce-with-ruby-on-rails

You can fetch the code from https://secure.near-time.com/svn/plugins/
trunk/tiny_mce

I provide Rake tasks to automate the installation of TinyMCE into
your public/javascripts (and will provide an upgrade task after
TinyMCE ships a new build).

Turning on the editor is done via a simple DSL in your controller:

uses_tiny_mce :only => [:new, :edit]

And a two liner in your layout view:

<% # Include TinyMCE before other JS to avoid problems -%>
<%= javascript_include_tiny_mce_if_used %>
<%= tiny_mce if using_tiny_mce? %>

I don’t think it could be made much easier. :slight_smile:

TinyMCE is excellent, highly customizable, and supports extension
through modular plugins.

I highly recommend it.

Cheers,
Blake

Blake W.
Lead Developer
Near-Time, Inc.

I’ve used innovastudio editor for the last couple of years. It is in
active
development so they release versions fairly regularily. I just
implemented
it for a Rails-based CMS and it is working great. I highly recommend it.

Safari support is still unusable for all WYSIWYG editors. I’d
provide an alternate editing interface built around Textile or
Markdown if you need to support Safari users.

Or provide links to Camino and Firefox as alternatives and a nice
message explaining that JavascriptCore’s design mode is broken and
they should complain to Apple.

Blake

This is great for technical users, but end-users in the real world
balk at using any sort of markup.

Some editors (like my favorite TinyMCE) emit pretty acceptable XHTML
output and certainly deliver a better experience to the average end
user.

I’ve been a fan of Textile for some time, but I tell you after
working off of TinyMCE for a couple of weeks its a much more natural
experience.

Cheers,
Blake

You don’t actually need to complain to Apple. Much better to contact
the developers themselves at http://webkit.opendarwin.org/ (And test
drive the beta version of Safari while you are doing it)

As you can see at
http://webkit.opendarwin.org/projects/compat/hitlist.html they are
well aware of this and are working on it. The dev blog for Safari is
also a great read for those who want to get more info on the web
standards.

On 6/6/06, Blake W. [email protected] wrote:

On May 28, 2006, at 9:47 PM, [email protected] wrote:

CMS system’s out there so there is some doco available.
Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

On Tue, 6 Jun 2006 11:05:12 +0200, Enrico F. wrote:

Actually Dojo works quite well.

I didn’t specify: it works well with Safari.

On Mon, 5 Jun 2006 23:01:30 -0400, Blake W. wrote:

Safari support is still unusable for all WYSIWYG editors. I’d
provide an alternate editing interface built around Textile or
Markdown if you need to support Safari users.

Actually Dojo works quite well. I’m going to put it in a rails app one
of these days (as soon as I finish some more pressing tasks).

It works perfectly with Safari. However, as I said I’ve not yet used it
as a developer, therefore I don’t know how easy is it to use.

On 6-jun-2006, at 5:01, Blake W. wrote:

Or provide links to Camino and Firefox as alternatives and a nice
message explaining that JavascriptCore’s design mode is broken and
they should complain to Apple.

Double ugh. Now that’s a reason to lock users out, I imagine.


Julian ‘Julik’ Tarkhanov
please send all personal mail to
me at julik.nl

On 6-jun-2006, at 11:29, Enrico F. wrote:

On Tue, 6 Jun 2006 11:05:12 +0200, Enrico F. wrote:

Actually Dojo works quite well.

I didn’t specify: it works well with Safari.

And there was a fair amount of faithful bitchin’ on the part of the
dojo developer about how terribly broken JSCore is :slight_smile:


Julian ‘Julik’ Tarkhanov
please send all personal mail to
me at julik.nl

On Tue, 6 Jun 2006 23:25:18 -0500, Rob S. wrote:

Actually, it doesn’t.

The demo I tried worked. However it had no link buttons.
Actually it seems we tried it not enough extensively. Thanks for
pointing it out. You saved us a lot of work, indeed. :slight_smile:

On 6/6/06, Enrico F. [email protected] wrote:

On Tue, 6 Jun 2006 11:05:12 +0200, Enrico F. wrote:

Actually Dojo works quite well.

I didn’t specify: it works well with Safari.

Actually, it doesn’t. The editor loads, but many of the most
important buttons (ie links and images) don’t work - this was true w/
0.2.2 and 0.3, it may be different in HEAD, but I doubt it. I also
ran into strange issues where the Editor would just continually load
in Safari and never complete, until Safari bombed - this only seemed
to happen where I was replacing a text area onload programmatically.

You can see editor 2 for yourself right here, btw - just try it in
Safari:

http://archive.dojotoolkit.org/nightly/tests/widget/test_Editor2.html

As a previous poster said, design mode in Safari is broken as only a
few pieces of the api are implemented. So any rich editor will be
broken unless the developers want to do a lot of Safari specific work
arounds (only to have to remove them later when the webcore team
catches up).