Created
October 5, 2015 02:48
-
-
Save sqfmason/72b664815dc4f211a216 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
# this is the form html | |
<div class="jumbotron"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-9"> | |
<h1>Tip calculator</h1> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-3"> | |
<form action="/result"> | |
<div class="form-group"> | |
<label for="amount">Amount</label> | |
<input type="text" class="form-control" id="amount" placeholder="$50.87"> | |
</div> | |
<div class="form-group"> | |
<label for="tip">Tip percentage</label> | |
<div class="radio"> | |
<label> | |
<input type="radio" name="tip" id="" value="10" checked> | |
10% | |
</label> | |
</div> | |
<div class="radio"> | |
<label> | |
<input type="radio" name="tip" id="" value="15"> | |
15% | |
</label> | |
</div> | |
<div class="radio"> | |
<label> | |
<input type="radio" name="tip" id="" value="20"> | |
20% | |
</label> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="num_people">num_people</label> | |
<input type="text" class="form-control" id="num_people" placeholder="2"> | |
</div> | |
<button type="submit" class="btn btn-default">Submit</button> | |
</form> | |
<footer></footer> | |
</div> | |
</div> | |
</div> | |
# this is the results html page | |
<div class="jumbotron"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<h3>Add a tip of $ <%=@result %> to bring your total amount to <%=@amount %> + <%=@number_of_people %>$</h3> | |
<h3>Each person tips:<%=@result%> $</h3> | |
</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment