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
| # 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 |
| // app/javascript/components/App.js | |
| import React from 'react' | |
| class App extends React.Component { | |
| render() { | |
| return ( | |
| <div> | |
| Hello world! | |
| </div> |
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:
| [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> |