Skip to content

Instantly share code, notes, and snippets.

View ashleygwilliams's full-sized avatar

ashley williams ashleygwilliams

  • 03:45 (UTC -05:00)
View GitHub Profile

#Questions

** Questions should be answered with the simplest, most barebone solution possible.

###1. Arrays

array = ["Blake","Ashley","Jeff"]

a. Add a element to an array
@ashleygwilliams
ashleygwilliams / index.md
Last active December 19, 2015 02:48
exercise for creating resourceful routes in sinatra with datamapper
@ashleygwilliams
ashleygwilliams / citibike_sinatra.md
Last active June 26, 2016 01:29
an app to practice forms in sinatra, using JSON station data from citibike NYC.

#citibike citibike Sinatra forms

Objectives

  1. create a form in HTML
  2. using ERB, populate a select element with options from a JSON file
  3. understand how to use the name and value attributes to populate a params hash of user inputted data
  4. create a route to respond to a post from the form
  5. create instance variables from the params hash in your route so you can use it in a view
  6. use embedded ruby to plot points on a map using javascript
@ashleygwilliams
ashleygwilliams / gist:5860467
Last active December 18, 2015 23:19
notes to help group build dropdown menu
do this first:
http://www.codeschool.com/courses/try-jquery
include jquery in your layout
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
stackoverflow: how do i change options in dropdown with jquery?
http://stackoverflow.com/questions/1801499/how-to-change-options-of-select-with-jquery
<option> MDN https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option
@ashleygwilliams
ashleygwilliams / sinatra_3.md
Last active December 18, 2015 22:18
part 3

#Sinatra: Part 3

Objectives

Continue re-creating the student website as a dynamic web application using Sinatra and the Student Class you created in the Student Class DB lab.

  • Add a route/controller for the students individual profile pages.

  • Add the ERB template for the students individual profile pages.

@ashleygwilliams
ashleygwilliams / sinatra_2.md
Last active December 18, 2015 22:09
part 2

#Sinatra: Part 2

Objectives

Continue re-creating the student website as a dynamic web application using Sinatra and the Student Class you created in the Student Class DB lab.

  • Add the static assets (stylesheets, javascripts, and images) from the student static website.

  • Style the students index page

Add your static assets

@ashleygwilliams
ashleygwilliams / sinatra_1.md
Last active December 18, 2015 22:08
part 1

Sinatra: Part 1

Objective

Re-create the student website as a dynamic web application using Sinatra and the Student Class you created in the Student Class DB lab.

Student ORM files Note1: If you use this ORM, it has a dependency on the Persistable module, you must grab and require this file. Note2: You MUST USE THE GEMFILE. All gems go in the gemfile, and no longer do we do "require 'sqlite3'" in our actual program. Files you wrote (like student.rb) are required as normal. Part 1: Rendering a list of students.

@ashleygwilliams
ashleygwilliams / sinatra_objectives.md
Created June 24, 2013 15:53
sinatra learning objectives

Sinatra

Learning Objectives

Level 0

  • scaffold a basic sinatra app
    • app.rb
    • config.ru
    • Gemfile
  • gemfiles, what are they
  • rubygems.org
@ashleygwilliams
ashleygwilliams / sinatra.md
Last active December 18, 2015 21:49
sinatra part 0

Student Sinata App: Part Zero

Objective

Get comfortable writing routes and creating ERB views in a very simple Sinatra App.

Tutorial

Part 1: Bootstrap the app