title: Getting signed out of the ruby application
body: <p>I am having a ruby on rails application.I added a new section called reports to the application. It has no model but a controller and many forms in the views folder.
  The functionality is working as desired.
  The problem I am facing facing is on clicking the submit button, the user who is signed in is signed out automatically.</p>
  
  <p>My code is :</p>
  
  <p>Reports Controller:</p>
  
  <pre><code>    class ReportsController &lt; ApplicationController
      def index
      @projects=Project.find(:all)
      @releases=Release.find(:all)
      @cycles=Cycle.find(:all)   
      report_type=params[:report_type]
      if report_type=="1" &amp;&amp; params[:cycles]     
      @cycle=Cycle.find(params[:cycles])
      @ics=@cycle.ics     
      puts " report_type===#{report_type}"
      end
      end
  
  
      def  update_releases 
       puts "inside releases"
       project = Project.find(params[:project_id]) 
  @releases = project.releases
  respond_to do |format| 
  format.js 
  end
  end
  
  
  def update_cycles 
  puts "inside update_cycles"
  release = Release.find(params[:release_id]) 
  @cycles =release.cycles
  respond_to do |format| 
  format.js    
  end 
  end 
  end
  </code></pre>
  
  <p>In index.html.haml :</p>
  
  <pre><code>-set_title "Reports"
  -content_for :content_title do
    = link_to "Test Case Manager", "/"
    &amp;raquo;
    = "Reports"
  %table.grid.full
  %tr
      %td.grid.full_panels{:style =&gt; "width: 30%"}
        -panel "Reports" do
          = render "reports",:report_type=&gt;params[:report_type]
      %td.grid.full_panels{:style =&gt; "width: 70%"}
        -table_panel "Report details" do
          = render "report_details",:report_type=&gt;params[:report_type]
  = javascript_include_tag "pages/ic"
  </code></pre>
  
  <p>_reports.html.haml:</p>
  
  <pre><code>%table.grid.full
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        =link_to 'Test Not Run Per Cycle',reports_path(:report_type=&gt;1)
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        = link_to 'Test Cycle Result Comparison',reports_path(:report_type=&gt;2)
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        = link_to 'Test Cycle Summary'
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        = link_to 'Tester summary per cycle'
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        = link_to 'Test Cycle Failure Report'
    %tr
      %td.grid.full_panels{:style =&gt; "width: 10%"}
        = link_to 'Release Test Results Summary'
  = javascript_include_tag "pages/ic"
  </code></pre>
  
  <p>_report_details.html.haml:</p>
  
  <pre><code>-if report_type == "1" 
     = render "tests_not_run_per_cycle",:report_type=&gt;report_type  
     = render "tests_not_run_per_cycle_reports",:report_type=&gt;params[:report_type]
  </code></pre>
  
  <p>_tests_not_run_per_cycle.html.haml:</p>
  
  <pre><code>-projects=Project.all
  -releases = Release.all
  -cycles=Release.all
  -form_tag reports_path(),:method =&gt; :get, :multipart =&gt; true  do  
    %table.grid.full_panels
    %tr      
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      Project:
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      //= select_tag "projects",options_from_collection_for_select(projects,"id","name",params[:projects]),{:onchange =&gt; "#{remote_function(:url  =&gt; {:action =&gt; "update_releases"},:with =&gt; "'project_id='+value")}"} 
      = select_tag "projects",options_from_collection_for_select(projects,"id","name",params[:projects]), :class =&gt; "update_releases",:include_blank=&gt;true
      //= select_tag 'projects',options_from_collection_for_select(projects, "id", "name"),:'data-remote' =&gt; 'true', :'data-url' =&gt; 'reports/update_releases', :'data-type' =&gt; 'json'  
      =hidden_field_tag "report_type","1"
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      Releases:
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      &lt;div id="releases"&gt;
      = render :partial =&gt; 'releases', :object =&gt; @releases
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      Cycles:
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      &lt;div id="cycles"&gt;
      = render :partial =&gt; 'cycles', :object =&gt; @cycles
  
  %tr      
    %td.grid.full_panels{:style =&gt; "width: 20%"}
    %td.grid.full_panels{:style =&gt; "width: 20%"}
    %td.grid.full_panels{:style =&gt; "width: 20%"}
      =submit_tag "Submit"
    %td.grid.full_panels{:style =&gt; "width: 20%"}
    %td.grid.full_panels{:style =&gt; "width: 20%"}
    %td.grid.full_panels{:style =&gt; "width: 20%"}      
  = javascript_include_tag "pages/ic"
  </code></pre>
  
  <p>_tests_not_run_per_cycle_reports:</p>
  
  <pre><code>-if report_type=="1" &amp;&amp; params[:cycles]
     -ic_to_platform_config = @cycle.ic_platform_configs
     %table
      %th Root
      %th Suite
      %th Case
      %th IC
      %th Executor
      %th Platform
      -@ics.each do |ic|
        %tr
      -ic_model=Ic.find(ic.id)
      - ic_rev=@cycle.get_ic_rev_assign(ic_model)
      - populate_table ic_rev, ic_to_platform_config[ic_model]
   = javascript_include_tag "pages/ic"
  </code></pre>
  
  <p>On clicking the submit button the user signed in gets signed out automatically.Please help me out here.</p>
  
  <p>Thanks,
  Ramya.</p>