localhost:3000 – index page
localhost:3000/#items – item page
localhost:3000/#items/10/index – item id 10
var link = 'localhost:3000/#items/10/index';
var arr = link.split('/');
console.log(arr[2]); //10
<input type='hidden' class='route-js' value='<%=params[:id]%>'>
var route=$('.route-js').val();