Skip to content

Commit

Permalink
add main component
Browse files Browse the repository at this point in the history
  • Loading branch information
01speed1 committed Jun 26, 2021
1 parent 7251061 commit 2aa62f4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.0.0
ruby-3.0.1
6 changes: 6 additions & 0 deletions app/controllers/static_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class StaticController < ApplicationController

def index
end

end
10 changes: 10 additions & 0 deletions app/javascript/components/HelloWorld.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';

export default function HelloWorld({ greeting }) {
return <>Greeting: {greeting} </>;
}

HelloWorld.propTypes = {
greeting: PropTypes.string
};
3 changes: 3 additions & 0 deletions app/views/static/index.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= javascript_pack_tag 'application'

= react_component("HelloWorld", { greeting: "Hello" })
6 changes: 6 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root 'static#index'

namespace :v1, default: { format: :json } do
#get :things, to: 'things'
end

end

0 comments on commit 2aa62f4

Please sign in to comment.