in the code I want to pass the search result's id value.id as a parameter to the expenses.show router but instead of passing the content of value.id, value.id in itself is the one being passed as a string. this is a laravel project btw.
@tykus it is my first time encountering render, in the search function do i make a new view where I can return all the search results or do i just return the results to the original page where i made the call from?
@j_watson, you make a view called partials/search-results.blade.php etc. with the @foreach chunk then render will prepare it. So when you call it from your success function its already the html you need. Its what you were trying to do before but without trying to write html with javascript, instead its a loaded partial "Server fetched partials"
@j_watson the idea of the partial is reusability; so your parent view can use it as well with an @include passing original results. The render function simply evaluates the partial with the given data and generates a HTML string that can be returned rather than a full Response. So, you only want the part of the DOM that is updated with the search results; i.e. the table (or table rows)