 <p>Do the following:</p> <pre><code>#config/routes.rb resources :jobs do get "search(/:keyword)", action: :show, on: :collection #-&gt; url.com/jobs/search?keyword=query || url.com/jobs/search/:keyword end #app/assets/javascripts/application.js $(document).on("keypress", "#search", function(e) { $.get("jobs/search", {keyword: $('#search').val()}); }); #app/controllers/jobs_controller.rb class JobsController &lt; ApplicationController def show if params[:keyword] @jobs = Job.where id: params[:keyword] else @job = Job.find params[:id] end respond_to do |format| format.js format.html {redirect_to customers_url} end end end #app/views/jobs/show.js.erb ("&lt;%=j render @jobs %&gt;").appendTo("#jobs-table"); </code></pre>