Last active
July 18, 2017 07:13
-
-
Save jamesmartin/ab52753be4ffb75be02a395add48842b to your computer and use it in GitHub Desktop.
radio buttons and checkboxes
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>Test</h1> | |
<% if !@p.nil? %> | |
<%= @p.inspect %> | |
<% end %> | |
<form method="post" action="/"> | |
<h2>Have you ever smoked?</h2> | |
<p> | |
<input type="radio" name="smoker" value="Yes"> Yes<br> | |
<input type="radio" name="smoker" value="No"> No<br> | |
</p> | |
<h2>Injury</h2> | |
<p> | |
<input type="checkbox" name="injury[]" value="Neck"> Neck<br> | |
<input type="checkbox" name="injury[]" value="Shoulders"> Shoulders<br> | |
<input type="checkbox" name="injury[]" value="Knee"> Knee<br> | |
</p> | |
<input type="submit" value="Go"> | |
</form> |
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
require 'sinatra' | |
get '/' do | |
erb :test, layout: false | |
end | |
post '/' do | |
@p = params | |
erb :test, layout: false | |
end |
Author
jamesmartin
commented
Jul 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment