Last active
March 23, 2017 01:09
-
-
Save geocodinglife/0b47970dbd1b934e8bf5f9b9e1d860da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#names").append("<%= escape_javascript(render @names) %>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
get 'welcome/index' | |
post 'welcome/index' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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