Skip to content

Instantly share code, notes, and snippets.

@jojo89
Created August 26, 2013 22:19
Show Gist options
  • Select an option

  • Save jojo89/6347352 to your computer and use it in GitHub Desktop.

Select an option

Save jojo89/6347352 to your computer and use it in GitHub Desktop.
<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>
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