title: Rails AJax get dynamic URL
body: <p>HI I am beginner in rails noe I am working with a music player application in rails 4 using jplayer and to create a play list I am using Ajax function </p>
  
  <pre><code>$.ajax({ 
      type: 'GET',
      url:"../albums.json",
      success: function(data){
                    myPlaylist.add({title:$(this).attr("names")})
                                          },
      error: function(xhr,status,error){
                        alert(error);
                      }
      });
  </code></pre>
  
  <p>what I want is to pass single album like albums/3.json to Ajax URL when I click the particular album to play ...any ideas will be welcome</p>