Instead of asking the user to click on links to navigate to a new page, how can I implement automatic page navigation? I would imagine there is a method something like: if condition then move_to :controller => ... :action => ... Is there??
on 2012-11-20 16:33
on 2012-11-20 16:43
On 20 November 2012 15:33, Joz Private <lists@ruby-forum.com> wrote: > Instead of asking the user to click on links to navigate to a new page, > how can I implement automatic page navigation? > > I would imagine there is a method something like: > > if condition then move_to :controller => ... :action => ... You can do this at the client end using javascript. Use the setTimeout method. See http://www.tizag.com/javascriptT/javascriptredirect.php for example. Colin
on 2012-11-22 10:46
Is there a way to do this without Javascript? I haven't used it before. For my Rails stuff at the moment (I'm just learning it) I want to stick to mainly Ruby and HTML, as that's all I really know at this stage ...
on 2012-11-22 11:38
On 22 November 2012 09:46, Joz Private <lists@ruby-forum.com> wrote: Please quote the previous message so that it is easier to follow the thread. The only way anyone reading this will know what you are talking about is by looking back at the earlier email. > Is there a way to do this without Javascript? Not as far as I am aware. > > I haven't used it before. For my Rails stuff at the moment (I'm just > learning it) I want to stick to mainly Ruby and HTML, as that's all I > really know at this stage ... In that case you will have to stick to basic features until you can get round to learning about javascript - which is essential for anything other than a basic site. You will also need CSS knowledge. Colin
on 2012-11-22 11:48
Colin Law wrote in post #1085864: > On 22 November 2012 09:46, Joz Private <lists@ruby-forum.com> wrote: > > Please quote the previous message so that it is easier to follow the > thread. The only way anyone reading this will know what you are > talking about is by looking back at the earlier email. > >> Is there a way to do this without Javascript? > > Not as far as I am aware. > >> >> I haven't used it before. For my Rails stuff at the moment (I'm just >> learning it) I want to stick to mainly Ruby and HTML, as that's all I >> really know at this stage ... > > In that case you will have to stick to basic features until you can > get round to learning about javascript - which is essential for > anything other than a basic site. You will also need CSS knowledge. > > Colin But there was only one previous post ... extra clutter wasn't needed. Ok, I've had a look at the Javscript and it seems ok. But now I've thought of another scenario: Up until now, I have had to request the user click on a hyperlink to navigate to the next page. But say the user inputs data to a form. Is it possible, once the data has been submitted (by clicking the "send" button), that this event can trigger automatic navigation to the next page?
on 2012-11-22 11:57
On 22 November 2012 10:48, Joz Private <lists@ruby-forum.com> wrote: >> > > But there was only one previous post ... extra clutter wasn't needed. I still had to look back at the previous message to remind myself what the question was about. Also remember these posts are archived and will be found by users searching for information. In that case it may not be trivial to see the previous post, and a message that says just "Is there a way to do this without Javascript?" > > Ok, I've had a look at the Javscript and it seems ok. But now I've > thought of another scenario: > > Up until now, I have had to request the user click on a hyperlink to > navigate to the next page. But say the user inputs data to a form. Is it > possible, once the data has been submitted (by clicking the "send" > button), that this event can trigger automatic navigation to the next > page? I don't understand the question. Once the user has submitted the form it is entirely under your control (in the controller action) which page appears next, so you can make it navigate wherever you like. Colin
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
Log in with Google account | Log in with Yahoo account
No account? Register here.