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.
2119f016588ba13373484491bd2dd6d1?d=identicon&s=25 Joe Peck (fatcatt316)
on 2007-06-18 20: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?
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2007-06-18 20:31
(Received via mailing list)
On Jun 18, 2007, at 2:01 PM, Joe Peck 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 Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
Fd31c83c788b7d57277e44c518232b4e?d=identicon&s=25 Dave Olsen (Guest)
on 2007-06-18 23: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 Peck <rails-mailing-list@andreas-s.net> wrote:
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--

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