Created
August 26, 2013 22:19
-
-
Save jojo89/6347352 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <div class="container"> | |
| <h1>Deaf Grandma</h1> | |
| <% if @grandma %> | |
| <p>Grandma says: "<span id="grandma_says"><%= @grandma %></span>"</p> | |
| <% end %> | |
| <form action="/grandma" method="post"> | |
| Say something to Grandma: | |
| <br> | |
| <input type="text" name="user_input"> | |
| <input type="submit" value="Say it!"> | |
| </form> | |
| </div> |
This file contains hidden or 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
| get '/' do | |
| erb :index | |
| end | |
| post '/grandma' do | |
| # "Implement the /grandma route yourself.<br>Params: <code>#{params.inspect}</code>" | |
| # @response = params[:user_input] | |
| # if @response = @response.upd | |
| if params[:user_input] != params[:user_input].upcase | |
| @grandma ="SPEAK UP SONNY!" | |
| else | |
| @grandma ="NOT SINCE 1989!" | |
| end | |
| erb :index | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment