Skip to content

Instantly share code, notes, and snippets.

@jesseclay
jesseclay / keybase.md
Last active January 12, 2017 10:56
keybase.md

Keybase proof

I hereby claim:

  • I am jesseclay on github.
  • I am jesseclay (https://keybase.io/jesseclay) on keybase.
  • I have a public key ASDrwPuWEEhFsoNuZKLskD_H-F97dXbkUom86ctlVpRuIQo

To claim this, I am signing this object:

This is a basic guide to utilizing Jquery and Ajax in Rails, written by Eric Chen, Christine Marquardt and Jesse Clayburgh.
Ajax: using Javascript to make requests to the server, parse the response, and update information on the current web page.
While Rails ships with CoffeeScript (a javascript compilier-- an more 'compact' way of writing Javascript), it's highly recommended to continue using Javascript like we've been using the past 3 weeks throughout phase II.
Rails uses a technique called "Unobtrusive JavaScript" to handle attaching JavaScript to the DOM.
Here's the simplest way to write JavaScript. You may see it referred to as 'inline JavaScript':
@jesseclay
jesseclay / index.html
Last active December 20, 2015 03:59 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>

Instructions:

  1. Download this application skeleton.
  2. Convert the app to use AJAX.
  3. Add any files you changed to your gist and submit your code.
class Vehicle
attr_reader :color, :status
def initialize(args)
@wheels = self.wheels
@seats = self.seats
@status = self.status
@color = args.fetch(:color) {self.color}
@speed = self.speed
end
@jesseclay
jesseclay / index.html
Last active December 12, 2015 02:39
Mainpage from my first Cardinal Webdev project!
<html>
<head>
<title>Welcome to PassFly!</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/redmond/jquery-ui.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>