title: Check that returns csv
body: <p>I would a checkbox that when check will return csv and html if otherwise.
  I follow this video and got the csv to work 
  <a href="http://railscasts.com/episodes/362-exporting-csv-and-excel?autoplay=true" rel="nofollow">http://railscasts.com/episodes/362-exporting-csv-and-excel?autoplay=true</a></p>
  
  <p>now I have a check_box_tag that is to be submitted with the form. if the check box is checked then it should render the csv.</p>
  
  <pre><code>=form_tag exams_path, method: :get do
    =text_field_tag :search, params[:search]
    =check_box_tag "csv"
    = submit_tag "Search by id", name: nil
  </code></pre>
  
  <p>Inside the controller it have </p>
  
  <pre><code>...
  params[:format] = "csv" if params[:csv]
  respond_to do |format|
    format.html
    format.csv {render text:@exams.to_csv}
  end
  ...
  </code></pre>
  
  <p>but this does not work.</p>