Skip to content

Instantly share code, notes, and snippets.

@spencereldred
spencereldred / rails_views_controllers_lesson.md
Last active August 29, 2015 14:00
Rails Views and Controllers Lesson

Rails Views and Controllers Lesson

  • Today we are going to review a completed rails app: Todo App.

  • Todo App is a complete implementation of a CRUD.

  • The morning we will review the Todo App in detail.

  • The afternoon lesson will be a code along to create the Todo App.

We will analyze the todo_app in detail

  • We will follow how the Views and the Controller communicate together.

    * We will follow a typical rails code development sequence.
@spencereldred
spencereldred / rspec_tests.md
Last active August 29, 2015 13:59
Rspec Test Lesson

RSpec Testing

  • TDD - Test Driven Development

Student Learning Objectives:

  • By the end of this lesson you should be able to:

    • 1) Set up an rspec testing environment for a ruby project

@spencereldred
spencereldred / polymorphic_association.md
Last active August 29, 2015 13:56
polymormic assiciations

Polymorphic Association

When you have one model that could belong to any one of a set of models.

Comments is the classic example.

A comments could belong to a book, a video or a photo.


Goals:

  • Understand overview of polymorphic relationships.

  • How to set up model relationships.
@spencereldred
spencereldred / rails_view.md
Last active January 3, 2016 09:19
Rails View Lesson

Rails View

  • Understand steps to set up rails app.

    *

    Start Sublime

    *

    Edit Gemfile - 'pry'

    *

    Bundle Install

    *

    Edit .gitignore file

    *

    Add Bootstrap

  • Understand steps to get rails app running.

    *

    Setup first route

    * Setup first Controller
@spencereldred
spencereldred / rspec_testing.md
Last active January 2, 2016 21:29
RSpec Testing of ruby programs

RSpec Testing

##BDD - Behavior Driven Development #Learing Objectives:

  • Understand BDD development flow

  • Install and configure RSpec

  • Understand basic RSpec blocks: describe, context, it

  • Understand how to write RSpec tests

  • Understand how to run RSpec tests

  • Understand how to make list of attributes and behaviors
@spencereldred
spencereldred / guestbook.rb
Created October 10, 2013 00:46
guestbook app with database. uses the params[:name] and params[:message] to create sql query.
require 'sinatra'
require 'sinatra/reloader'
require 'sqlite3'
db = SQLite3::Database.new('guestbook.sqlite3');
sql = "select * from guestbook;"
sql_name = "select name from guestbook where id = 1"
@result = db.execute(sql);
@spencereldred
spencereldred / gist:6833943
Created October 4, 2013 22:32
Spencer's Week 2 Assessment
Spencer Eldred
October 4, 2013
1.)
My script is loading fine, but separate style sheets aren't working
<!DOCTYPE html>
<html>
@spencereldred
spencereldred / gist:6830839
Created October 4, 2013 18:53
Essay on Jennifer Dewalt's web developer journey.
You can't possibly teach yourself how to be a web developer in 180 days, right? Yet that is what Jennifer Dewalt did. In her blog, blog.jenniferdewalt.com, Jennifer outlines her approach of making and publishing one web site per day for 180 days. Additionally, each web site is accompanied by a blog post. The entire collection of 180 web sites can be found at jenniferdewalt.com. Her sites start out as small HTML and CSS projects and gain sophistication as she dabbles into the realms of Rails and Node.
Having a well-defined mission and setting goals to reach that mission is what it is all about. A mission statement should be clear, measurable, and time bound. Jennifer's mission, 180 websites in 180 days, is short, sweet, and fits the bill. Rather than by reading books or attending a bootcamp, Jennifer gained the knowledge she needed by relying on "StackOverflow, MDN, CSS Tricks, blogs and demos". (Dewalt)
My mission is to have a job as a web developer by March, 2014. (Earlier would be better, but I don't want t
@spencereldred
spencereldred / gist:6817851
Created October 3, 2013 22:05
Spencer's movie.rb file of routes
require 'sinatra'
require 'sinatra/reloader'
require 'typhoeus'
require 'json'
# @query = "Star Wars"
# movie_list_request = Typhoeus.get(
# "http://www.omdbapi.com",
# :params => { :s => @query }
@spencereldred
spencereldred / gist:6796568
Created October 2, 2013 16:35
Sinatra - stock quote app - stock_app.rb file.
require 'sinatra'
require 'sinatra/reloader'
require 'yahoofinance'
get '/' do
@method = "post"
@action = "/stock"
erb :form