Hello, I have a page. In that I am showing dropdown list. According to the values I am viewing the tables. When I am selecting values from the dropdown, it renders a table & views it. Everything is happening on client side. When I refresh the page, it goes to the fist value in the dropdown (rather I should be in the last selected dropdown value). How can I manage this in client side session ? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/A3UN_4p1wN8J. For more options, visit https://groups.google.com/groups/opt_out.
On 12 September 2012 10:15, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I have a page. In that I am showing dropdown list. According to the values I > am viewing the tables. > When I am selecting values from the dropdown, it renders a table & views it. > Everything is happening on client side. When I refresh the page, it goes to > the fist value in the dropdown (rather I should be in the last selected > dropdown value). > How can I manage this in client side session ?I don''t understand what you mean by client side session. If you mean how to use the session variable in rails then have a look at the Rails Guide on Active Controller, it has a section of the use of the session variable. While you are at it work through all the other guides, they will answer many of your questions. Also work right through a tutorial such as railstutorial.org which will introduce you to the basics of Rails. Colin> > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/A3UN_4p1wN8J. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Here is my code :- <script type="text/javascript"> $(document).ready(function () { $(''#table_user_registration'').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); $(''#table_download_file'').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); $(''#table_user_activation'').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers" }); $("#user_registration").show(); // Default I am setting to this on coming to this page. How can I change this ? }); var chng = "user_registration"; function audit_options(selected_audit){ $("#"+ chng ).hide(); $("#" + selected_audit ).show(); chng = selected_audit; } </script> <select id="audit_options" onchange="audit_options(this.value);" > <option value="user_registration">User Registration</option> <option value="download_file">File Download</option> <option value="user_activation">User Activation</option> </select> <div id="user_registration" style="display: none" > I have here my Table 1 </div> <div id="download_file" style="display: none" > I have here my Table 2 </div> <div id="user_activation" style="display: none"> I have here my Table 3 </div > So, if Iam in 2nd value in the dropdown. & I do a refresh page. It comes to the first. On Wednesday, September 12, 2012 2:56:51 PM UTC+5:30, Colin Law wrote:> > On 12 September 2012 10:15, Avi <aavinas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> > wrote: > > Hello, > > > > I have a page. In that I am showing dropdown list. According to the > values I > > am viewing the tables. > > When I am selecting values from the dropdown, it renders a table & views > it. > > Everything is happening on client side. When I refresh the page, it goes > to > > the fist value in the dropdown (rather I should be in the last selected > > dropdown value). > > How can I manage this in client side session ? > > I don''t understand what you mean by client side session. If you mean > how to use the session variable in rails then have a look at the Rails > Guide on Active Controller, it has a section of the use of the session > variable. > > While you are at it work through all the other guides, they will > answer many of your questions. > > Also work right through a tutorial such as railstutorial.org which > will introduce you to the basics of Rails. > > Colin > > > > > Thanks > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:>. > > > To unsubscribe from this group, send email to > > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/A3UN_4p1wN8J. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/xgfligGAJ8oJ. For more options, visit https://groups.google.com/groups/opt_out.
On Wed, Sep 12, 2012 at 3:03 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $("#user_registration").show(); > // Default I am setting to this on coming to this page. How can I change this ?1) set the value on the server on select and get it back on page reload 2) save it to a cookie 3) save it to HTML5 Local Storage -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.