Forum: Ruby on Rails right click or Context Menu in ruby without javascript

Posted by nikhil rn (nikhilrkn)
on 2012-11-14 07:46
Hi,
   This query is a replica of the link
http://railsforum.com/viewtopic.php?id=51231.

As I was unable to get any replies from the rails forum, I am posting
the same here.

    I have developed an app using Rails 3. I have a table made to look
like a calendar. I wanted to know if there were any methods or gems to
acheive right click(context menu) action on the dates WITHOUT
javascripts or jQuery. Please note, I am developing this on Rails 3.
Posted by Norbert Melzer (Guest)
on 2012-11-14 08:36
(Received via mailing list)
That has nothing to do with rails. Also I dont believe it would be 
possible
without Javascript in general.
Am 14.11.2012 07:46 schrieb "nikhil rn" <lists@ruby-forum.com>:
Posted by Colin Law (Guest)
on 2012-11-14 10:06
(Received via mailing list)
On 14 November 2012 07:35, Norbert Melzer <timmelzer@gmail.com> wrote:
> That has nothing to do with rails. Also I dont believe it would be possible
> without Javascript in general.

It can also be done with html5 I believe, if the user is using an
html5 compliant browser.
http://davidwalsh.name/html5-context-menu

Colin
Posted by nikhil rn (nikhilrkn)
on 2012-11-14 10:34
Norbert Melzer wrote in post #1084375:
> That has nothing to do with rails. Also I dont believe it would be
> possible
> without Javascript in general.
> Am 14.11.2012 07:46 schrieb "nikhil rn" <lists@ruby-forum.com>:

Thank you for your reply..
Posted by nikhil rn (nikhilrkn)
on 2012-11-14 10:39
Colin Law wrote in post #1084386:
> On 14 November 2012 07:35, Norbert Melzer <timmelzer@gmail.com> wrote:
>> That has nothing to do with rails. Also I dont believe it would be possible
>> without Javascript in general.
>
> It can also be done with html5 I believe, if the user is using an
> html5 compliant browser.
> http://davidwalsh.name/html5-context-menu
>
> Colin

Thank you Colin for your reply. HTML 5 is my last resort. I am afraid it 
may reduce the scope of number of users. I was wondering if I can get 
the right click handler of the browser. So that, it would solve my 
problem.
Posted by Matt Jones (Guest)
on 2012-11-14 13:33
(Received via mailing list)
On Wednesday, 14 November 2012 04:06:21 UTC-5, Colin Law wrote:
>
> Colin
>
>
Note that the HTML5 part of that only gets you the *menu* - actually 
doing
anything when things are selected from the menu is only possible with 
JS.

--Matt Jones
Posted by Colin Law (Guest)
on 2012-11-14 14:15
(Received via mailing list)
On 14 November 2012 12:32, Matt Jones <al2o3cr@gmail.com> wrote:
>> html5 compliant browser.
>> http://davidwalsh.name/html5-context-menu
>>
>> Colin
>>
>
> Note that the HTML5 part of that only gets you the *menu* - actually doing
> anything when things are selected from the menu is only possible with JS.

Good point.

Colin
Posted by nikhil rn (nikhilrkn)
on 2012-11-21 06:21
I finally decided to take up the right click using HTML5. Thank you all. 
I referred David Walsh website for the 
same(http://davidwalsh.name/html5-context-menu). Is there a way to 
remove the system generated right click options?
Posted by Walter Davis (walterdavis)
on 2012-11-21 17:36
(Received via mailing list)
On Nov 21, 2012, at 12:21 AM, nikhil rn wrote:

> I finally decided to take up the right click using HTML5. Thank you all.
> I referred David Walsh website for the
> same(http://davidwalsh.name/html5-context-menu). Is there a way to
> remove the system generated right click options?

You could trap them in JavaScript and return event.preventDefault() to 
stop the normal response from happening.

Have a google for the right way to trap a right-click -- it's very 
popular in anti-piracy scripts.

Walter
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.