Answer the question
In order to leave comments, you need to log in
How to update part of a page by submitting a form (Rails 5 and Turbolinks 5)?
when i send to action "filter" controller "homes":
def filter
@comments = Home.where("name like ?", "%#{params[:name]}%")
render :index
end
<%= link_to 'filter', homes_filter_path(name:'an')%>
<%= form_tag homes_filter_path, method: 'post', remote:true do %>
<%= text_field_tag :name %> #в name => 'an'
<%= submit_tag 'Submit'%>
<% end %>
root 'homes#index'
#get/post сдеано для удобства, по одиночке тоже пробовал - эффект аналогичный
get 'homes/filter'
post 'homes/filter'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question