Dear community,
I have a small concern about remote true.
I am building simple twitter site. Let's say user has "tweet" from on
the main page and a list of tweets below.
here is what I do:
<%= form_tag("/tweets", method: "post", class: "new-tweet") do %>
<%= label_tag(nil, "New tweet") %>
<%= text_field_tag(:text,nil,remote:true, placeholder: "Enter your
tweet message here. Limit 140 symbols", maxlength: 140) %>
<%= submit_tag("Tweet") %>
<% end %>
<div class="tweets">
<% if @tweets %>
<% @tweets.each do |tweet| %>
<div class="tweet"><%= tweet.text %></div>
<% end %>
<% end %>
</div>
route /tweets leads to another controller which actually adds a tweet to
the users collection which is displayed on the main page. My question
is: Does it make sense to use "remote: true" in the form here in order
to not reload all page.
If my question does not make sense, here is a deal. How does
"remote:true" actually works and what benefits does it give?
--
Posted via
http://www.ruby-forum.com/.