Skip to content

Instantly share code, notes, and snippets.

@notmarkmiranda
Forked from Carmer/Intro_to_sinatra_check.md
Last active March 22, 2016 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notmarkmiranda/249faa5e193c6d2f4bdf to your computer and use it in GitHub Desktop.
Save notmarkmiranda/249faa5e193c6d2f4bdf to your computer and use it in GitHub Desktop.

Introduction to Sinatra

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

  • It is the file that directs requests to specific places based on their address passed.

2. How do you pass variables into the views?

  • Instance Variables & :locals hash

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

  • <%= %> and <% %>

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

  • hash, params

5. What are params?

  • it's a hash of key/value pairs from a form? i think?
@Carmer
Copy link

Carmer commented Mar 22, 2016

Not all of the key/value pairs in the params hash are from the params, but yes, data coming from a form will be passed through in params as well.

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