Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Created January 12, 2017 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trevorturk/9b74f03ea149a807493b29769a0bffeb to your computer and use it in GitHub Desktop.
Save trevorturk/9b74f03ea149a807493b29769a0bffeb to your computer and use it in GitHub Desktop.
Single page Rails 5 app
# gem install bundler
# ruby hello_world.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '~> 5.0'
end
require 'action_controller/railtie'
class HelloWorld < Rails::Application
routes.append do
root to: 'hello#world'
end
config.secret_key_base = SecureRandom.hex(30)
config.eager_load = false
config.logger = Logger.new(STDOUT)
end
class HelloController < ActionController::Base
def world
render plain: 'Hello, World!'
end
end
HelloWorld.initialize!
Rack::Server.start app: HelloWorld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment