Answer the question
In order to leave comments, you need to log in
How to update data with an Ajax request in Rails?
Hello. Tell me how to update the information in the block using an Ajax request. Update once every ten seconds.
What file should I write javascript to?
my_controller.rb
def index
@all_users = User.where(#здесь парамаетры поиска)
@active_users = User.where(#здесь параметры поиска)
end
<h1>Статистика</h1>
<h2>Всего пользователей: <%= @all_users.count%> </h2>
<h2>Активных пользователей: <%= @active_users.count%> </h2>
Answer the question
In order to leave comments, you need to log in
I think it will be clear here, just change it so that it was by the timer, and not by the search.
railscasts.com/episodes/240-search-sort-paginate-w...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question