title: ActionController::UnknownFormat (Ruby on Rails)
body: <p>I am creating a Ruby on Rails application where I render my 'new.html.erb' (in my klass controller) and on top of it render my partial '_select_previous.html.erb,' also, I have a 'link_to' to switch back and forth from one to the other. However, when I try to start my project at the 'index.html.erb' and then use a 'link_to' to go to the new file, it shows me that error above.</p>
  
  <p>I am using jQuery to do the switching from one view to the other.</p>
  
  <p>Here is my new.html.erb:</p>
  
  <pre><code>&lt;p&gt; Or select from the previous created classes &lt;%= link_to "here", 
  new_klass_path, id: "link_to", :remote =&gt; true %&gt; &lt;/p&gt;
  
  &lt;div id="previous"&gt;
     &lt;%= render :partial =&gt; 'select_previous' %&gt;
  &lt;/div&gt;
  
  &lt;div id="content"&gt;
   &lt;!-- Ruby form --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my klasses controller:</p>
  
  <pre><code>def index
      @klass = Klass.all.paginate(:page =&gt; params[:page])
      #import_klasses(@klass)
  end
  
  def new
      @klass = Klass.new
      #saved = @klass.save
      #@klass.save!
      #if saved
         #s1 = Student.last.id
         #k1 = Klass.last.id
         #@enrollments = Enrollment.new(student_id: s1, klass_id: k1)
         #binding.pry
         #@enrollments.save!
       #redirect_to :controller =&gt; 'enrollments', :action =&gt; 'index'
       #flash[:alert] = "Class Created"
    #end
  #end
  
    respond_to do |format|
       format.html {}
       format.js
    end
  end
  </code></pre>
  
  <p>And this is my show.js:</p>
  
  <pre><code>$(document).ready(function() {
  $("#days").hide();
  $("#grade").hide();
  $("#class").hide();
  $("#all").hide();
  $("#previous").hide();
  
  $("#link_to").click(function () {
      var count = $(this).data("count") || 0;
      if(count == 1)
      {
          $("#content").hide();
          $("#previous").show();
      }
      else if(count == 2)
      {
          $("#content").show();
          $("#previous").hide();
          count = 0;
      }
  
      $(this).data("count", ++count);
  });
  });
  </code></pre>
  
  <p>Thank in advance for any help you may provide me.</p>