Thanks for the reply Colin. 

We do not know the user ids before hand. They will sign up for the research 
study, and the admin will decide which users to pair among the ones online. 
One user may be paired with three to four other users one after another. I 
want to have the admin control over the process so that we could pair a 
user with a third online user if one from the original pair got offline and 
did not return. So the decision about which url to redirect to must be made 
dynamically. 

Do you think the Table approach would still work in the above scenario? 

I was thinking of building some sort of a polling mechanism (i'm not super 
clear on how to do that as I am relatively new) where the browsers contact 
the server to confirm their online status. However I was confused as to how 
I could redirect two browsers to a common url.

I found this on stack-overflow: 
http://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call/1534662#1534662
 
Which seems to be a promising solution. What do you think? 

On Friday, 19 April 2013 00:45:18 UTC-7, Colin Law wrote:
>
> On 19 April 2013 07:00, karan verma <karan....@gmail.com <javascript:>> 
> wrote: 
> > Hi 
> > 
> > I am building a Rails application which aims at facilitating two users 
> to 
> > collaborate on a web page based on their user id. The user matching 
> process 
> > is a controlled one since the app is for research purposes. To support 
> the 
> > same I am also building an admin interface which will allow the admin to 
> > match two users so that both of them are redirected to a certain 
> webpage. 
> > 
> > How can I force the user browsers to redirect to a common page, that I 
> > selected? 
>
> You could save the redirect requirement in a table in the database, 
> with an appropriate relationship with the user, then use a before 
> filter in the controller to check whether a redirect is required and 
> do it. 
>
> Colin 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/cV6UtN3o2oUJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to