title: Render a partial view via ajax in Ruby on Rails
body: <p>currently i am trying to make my rails app single paged, but i am having some problems with the rendering of partials.. Now here is my controller code:</p>
  
  <pre><code>class WelcomeController &lt; ApplicationController
  
      def create
          @welcome = WelcomeController.new
          render :partial =&gt; 'enjoy'
      end
  
      def index
          if params[:id] == 'enjoy'
              @partial_view = 'enjoy'
          elsif params[:id] == 'about'
              @partial_view = 'about'
          else
              @partial_view = 'main'
          end
      end
  
  end
  </code></pre>
  
  <p>So this controller is linked to my view, and for the pages to change i was using the code in the index action, but now i am trying to use the thing in the create action. The code of my index.html.slim where i am trying to call the create action is:</p>
  
  <pre><code>        div id="content"
  
          = form_tag(:url =&gt; {:action =&gt; 'create'},
                  :update =&gt; "content", :position =&gt; :bottom,
                  :html =&gt; {:id =&gt; 'subject_form'}, 
                  :remote =&gt; true)
  
              = submit_tag 'Add'
  </code></pre>
  
  <p>So on button click 'Add', i am expecting the content from _enjoy.slim.html, which is my partial to go into the div with id "content", but when the button is clicked and the _enjoy.html.slim is rendered it loads on top of the whole index.html.slim page... So i am stuck at that, how can i make it load into the certain div?</p>
  
  <p>Thanks a ton to anyone who has an answer to this one {:</p>