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/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1f427368f2ec269f4d1865fe71077718%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to