Skip to content

Instantly share code, notes, and snippets.

@jdliss
Forked from Carmer/Intro_to_sinatra_check.md
Last active March 22, 2016 04:06
Show Gist options
  • Save jdliss/c3376e5cfb990f383854 to your computer and use it in GitHub Desktop.
Save jdliss/c3376e5cfb990f383854 to your computer and use it in GitHub Desktop.

Introduction to Sinatra

1. What is the purpose of the server file (routing)?

  • The server file contains the routing information for what to do and what to display when different requests are recieved.

2. How do you pass variables into the views?

  • Throw your stuff into an instance variable, or pass it in using hash syntax, "new var name (for use in view)" => "what you want to pass to the view"

3. How can we interpolate ruby into a view (html)?

  • using the <%(=) %> tags

4. In what format does data come in from a view/form? What do we call it?

  • it comes in as a hash, and its called params

5. What are params?

  • data submitted through a form
@Carmer
Copy link

Carmer commented Mar 22, 2016

Not all the key/value pairs in the params hash will be from a form, but yes data from a from will also be passed through in the params hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment