Skip to content

Instantly share code, notes, and snippets.

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

Introduction to Sinatra

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

is Runner file of application, connects app with http server through verbs and path including erb files (views)

2. How do you pass variables into the views?

through local or instance variables defined in server file

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

trough erb. 2 types of tags <% %> either with our without = sign. with desplays the result of ruby evaluation without only evaluates code.

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

It comes in in form of hash called params. data is accessible via keys which can be called as string or symbol

5. What are params?

params is the hash containing data from user coming in through forms

@Carmer
Copy link

Carmer commented Mar 22, 2016

Looks good

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