Wiki like editing

Shandy Nantz wrote:

Anyone know of good tutorials on how to make an editing tool. I have one now for my blog site but some of the HTML tags get stripped away when I need to re-edit. What I would like is a tool that always me to add the tags that I want by clicking a button and maybe even do a preview kind of thing (like a wiki). The way I work things now is to save my entries to a database table, so I wonder if things get stripped away after being pulled from the table? Thanks in advance,

-S

Anybody? I'm thinking about doing some character interruptitation so the HTMNL tags don't get stripped away - something like ':p:' for a '<p>' and ':-p:' for a '</p>. I don't know. I was just wondering if someone has every tried anything like it in the Ruby world? I imagine that someone has, I'm just looking for a few pointers before I get started.

-S

Thorsten Mueller wrote:

not sure, if that's what you're looking for, but we used tinyMCE as editor for a few projects and it worked fine. it's easy to write plugins, eg to upload images and place them (or anything else like tags) in the content.

http://tinymce.moxiecode.com/

That does look very nice, but what I was looking for was helpfull hints on how to do something like myself. I thought such a project would be a really a really cool way for someone like me get more practice under my belt using R0R.

looks more like a way to get a lot of practice in html & JavaScript. and that is a pain...

Thorsten Mueller wrote:

looks more like a way to get a lot of practice in html & JavaScript. and that is a pain...

And that could be. I need brushing up on my JavaScript skills too. Any helpful references on how to do this in JavaScript would be welcome as well.

-S

You should know, that writing a WYSIWYG editor like TinyMCE is:

a) Very non-trivial - it is a LOT of work

b) Has virtually nothing to do with RoR so you won't learn RoR that way

Eno wrote:

Thorsten Mueller wrote: > looks more like a way to get a lot of practice in html & JavaScript. and > that is a pain...

And that could be. I need brushing up on my JavaScript skills too. Any helpful references on how to do this in JavaScript would be welcome as well.

You should know, that writing a WYSIWYG editor like TinyMCE is:

a) Very non-trivial - it is a LOT of work

b) Has virtually nothing to do with RoR so you won't learn RoR that way

-- A

I do have a very basic working example now in place on my website, so I know I can do it, or at least something similar in RoR. I have been programming in RoR now for almost a year and while I am relatively new to the game I am still of the opinion that almost anything can be done in RoR - my current problem included. My problem with the current working example is that some of the HTML gets stripped away. I do have ideas on how to make it more robust, but was simply looking at this as a way to heighten my programming skill - in RoR and otherwise. While my general knowledge of Rails is pretty grounded, my skills in ruby have room for improvment.

I fully understand that it is a LOT of work, which, again, is kind of the appeal. I also know that there are other add-ons out there that do exactly what I am trying to do and odds are I might not get the thing working, but I plan on giving it the 'ol college try. Thanks for all the feed back,

-S

-- A

I do have a very basic working example now in place on my website, so I know I can do it, or at least something similar in RoR. I have been programming in RoR now for almost a year and while I am relatively new to the game I am still of the opinion that almost anything can be done in RoR - my current problem included. My problem with the current

I think you're slightly missing the point. Rails is something that happens server side, whereas this is a client side problem. That doesn't necessarily make it a bad thing to do, but you won't further your understanding of rails by doing it.

working example is that some of the HTML gets stripped away. I do have ideas on how to make it more robust, but was simply looking at this as a way to heighten my programming skill - in RoR and otherwise. While my general knowledge of Rails is pretty grounded, my skills in ruby have room for improvment.

If html is getting stripped away it's probably because you're stripping it yourself (that's what the h function does), or because what you're producing is invalid html, in which case what happens is pretty much up to the browser but might look as if html was being stripped.

Fred

Frederick Cheung wrote:

If html is getting stripped away it's probably because you're stripping it yourself (that's what the h function does), or because what you're producing is invalid html, in which case what happens is pretty much up to the browser but might look as if html was being stripped.

Fred

I will have to look into that. I saw that method in use in an example I was looking at the other day and, to be honest, I had no idea of what it was for. The HTML isn't being stripped out by me, I do know that, because it does display properly, only when I pull it back does some HTML tags (usually the ending tags) get stripped away.

Basically what I have is a textarea that I can enter text and HTML into; I save it and get a preview of it in a edit_in_place field (maybe not the way to go, I don't know, it was a solution I threw together in less than half an hour). It's when I click on the edit_in_place field that stuff gets stripped away. Thanks Fred,

-S