Skip to content

Instantly share code, notes, and snippets.

View hpjaj's full-sized avatar

Harry Levine hpjaj

View GitHub Profile
# config/routes.rb
Rails.application.routes.draw do
root 'pages#index'
end
# app/controllers/pages_controller.rb
class PagesController < ApplicationController
def index
end
end
// app/javascript/packs/index.js
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file,
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom
// of the page.
import React from 'react'
import ReactDOM from 'react-dom'
import App from '../components/App'
import PropTypes from 'prop-types'
const Hello = props => (
<div>Hello {props.name}!</div>
)
Hello.defaultProps = {
name: 'David'
}
// app/javascript/components/App.js
import React from 'react'
class App extends React.Component {
render() {
return (
<div>
Hello world!
</div>
# Gemfile
group :development, :test do
gem 'rspec-rails', '~> 3.8'
end
@hpjaj
hpjaj / test-2.jsx
Last active November 14, 2018 02:47
// app/javascript/components/App.js
import React from 'react'
class App extends React.Component {
render() {
return (
<div>
Hello world!
</div>
@hpjaj
hpjaj / rails-with-react-part-1.md
Last active November 13, 2018 21:09
Tutorial Series: Rails with React - One Repo

Rails with React - One Repo

Part 1 of 3: Setting React as the view layer

This tutorial series will walk you through creating a Ruby on Rails web application that uses React as its view layer, all in one repository.

The primary technologies that will be included are:

  • Rails 5.2.1
    • Ruby 2.5.3
  • Postgresql
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout: FAILURE STATE
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout:
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout: https://search.usa.gov/api/v2/search/i14y?access_key={KEYHERE]=&limit=10&offset=0&affiliate=va&query=benefits
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout:
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout: 429
[2018-10-31 18:36:23,076] ip-172-30-18-102/INFO/stdout:
[2018-10-31 18:36:23,077] ip-172-30-18-102/INFO/stdout: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>429 Too Many Requests</title>
</head><body>

Questions for TeamSite sync up on 09/26/2018

Whitelisting

Whitelisted pages:

['/', '/disability', '/facilities', '/welcome-kit']