Skip to content

Instantly share code, notes, and snippets.

@geocodinglife
Last active March 23, 2017 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geocodinglife/0b47970dbd1b934e8bf5f9b9e1d860da to your computer and use it in GitHub Desktop.
Save geocodinglife/0b47970dbd1b934e8bf5f9b9e1d860da to your computer and use it in GitHub Desktop.
<h1>How remote true works</h1>
<%= form_tag remote: true do %>
<%= text_field_tag "name" %>
<%= submit_tag "sumit you name" %>
<% end %>
<div style="border: 1px red solid" id="names">
<%= @names %>
</div>
$("#names").append("<%= escape_javascript(render @names) %>");
Rails.application.routes.draw do
get 'welcome/index'
post 'welcome/index'
end
class WelcomeController < ApplicationController
def index
@names = params[:name]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment