How to disable ctrl + c key in ruby on rails

I am showing document in browser
i want to disable the copy option ctrl + c key in ruby
please help me out

Sujith Gangaraju wrote:

I am showing document in browser
i want to disable the copy option ctrl + c key in ruby
please help me out

Might work to do it the traditional Ruby way:

http://betterlogic.com/roger/?p=110

windows:
trap :INT, proc { ‘ha got your ctrl-c!’ }

and linux

trap ”SIGUSR1″, proc {’got it in linux, too’}

I think. Maybe add to environment.rb?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jul 25, 2008, at 7:19 AM, Roger P. wrote:

trap :INT, proc { ‘ha got your ctrl-c!’ }

and linux

trap ”SIGUSR1″, proc {’got it in linux, too’}

I think. Maybe add to environment.rb?

Posted via http://www.ruby-forum.com/.

As I see it: he doesn’t want the user to copy text.

Not the answer you might expect: don’t even try. You showed him the
text. If he is serious, he will use the old analog method of copying.

Regards,
Florian G.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkiJkAEACgkQJA/zY0IIRZaWTwCdGtDS/hlMtDqQr9pfWevYGQ6s
xQkAnitMod6+mKZ0IgYV0syJyPM3Uosc
=/UlL
-----END PGP SIGNATURE-----

On 25 Jul 2008, at 06:19, Roger P. wrote:

trap :INT, proc { ‘ha got your ctrl-c!’ }

and linux

trap ”SIGUSR1″, proc {’got it in linux, too’}

I think. Maybe add to environment.rb?

That would stop the Rails application from processing a ctrl-c on the
server keyboard (if it has one) but would make no difference in the
browser as the Ruby code doesn’t run there.

Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net

raise ArgumentError unless @reality.responds_to? :reason