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 <[email protected] <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 
> > [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
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.


Reply via email to