title: How to render several templates from a sub directory in ruby on rails
body: <p>I have some templates stored in my pages view directory:</p>
  
  <p>Pages/settings/edit_account/
  basic_info.html.erb
  relatives.html.erb
  contact.html.erb</p>
  
  <p>I have a piece of javascript using the jquery .load function. I'm basically allowing users to click the links on a page: basic info, relatives, contact and have the information they need to see in order to make the edits show on the same page without it refreshing. It works perfectly fine if I use this path "profile_path" which is a path I have set up in my routes.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
        $("#theBasics").click(function() {
            $("#editProfileContent").load(&lt;%= profile_path %&gt;);
   });
  </code></pre>
  
  <p>What  I want to do though is set up more of those functions for each of the templates in pages/settings/edit_account/</p>
  
  <p>This doesn't work:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
        $("#theBasics").click(function() {
            $("#editProfileContent").load(&lt;%= render 'pages/settings/edit_account/basic_info' %&gt;);
  
        });
  </code></pre>
  
  <p>I could create several actions in the controller and set up routes for them or I could create a whole new controller.</p>
  
  <p>But there must be a much more cleaner way of achieving what I'm trying to achieve. Can't I use 1 action for all the templates?</p>
  
  <p>I can get this working if I put render 'pages/settings/edit_account/basic_info' into an action in the pages controller then in the javascipt .load function I just call the action route and it works but I can only render one template at a time.</p>
  
  <p>I hope I haven't confused anyone.</p>
  
  <p>Help would be appreciated.</p>