Forum: Ruby on Rails QUESTION: Insert tags around highlighted text

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe P. (Guest)
on 2007-06-18 22:01
Yello,

I have a textarea where the user can write a paragraph.  I want to be
able to let them highlight some of their text and then hit a "URL"
button which will insert "[LINK]" before the highlighted text and
"[/LINK]" after the text.

Does anyone know how to do this?
Rob B. (Guest)
on 2007-06-18 22:31
(Received via mailing list)
On Jun 18, 2007, at 2:01 PM, Joe P. wrote:

>
> Yello,
>
> I have a textarea where the user can write a paragraph.  I want to be
> able to let them highlight some of their text and then hit a "URL"
> button which will insert "[LINK]" before the highlighted text and
> "[/LINK]" after the text.
>
> Does anyone know how to do this?

http://www.google.com/search?q=tiny+mce

Or use something like RedCloth (textile) to do the markup.

-Rob

Rob B.    http://agileconsultingllc.com
removed_email_address@domain.invalid
Dave O. (Guest)
on 2007-06-19 01:21
(Received via mailing list)
While it's going to be a little bit of overkill you can check out our
Textile Editor Helper plugin to learn how to do what you're asking.
The javascript is pretty simple and straightforward.

http://slateinfo.blogs.wvu.edu/plugins/textile_editor_helper

On 6/18/07, Joe P. <removed_email_address@domain.invalid> wrote:
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--

Proud supporter of DC United
This topic is locked and can not be replied to.