This may have been asked before and i can not find anything that would work yet
I am tring to pass a little bit of information into a button that will forward a user to another page.
function addMultiple(){
var id = $("#truck_company_id").val();
//dont really want to do this:
//window.location.replace("http://www.website.com/companies/"+id+"/trucks");
//want to do it this way so will work in development
window.location = <%= trucks_company_path(id) %>;
}
all i need to do is direct a user to the correct website after they click this button.
<button id="class-list" onclick="addMultiple()" class="btn btn-warning pull-right" style="margin: 0;">Add Multiple Trucks</button>