22. HelloWorld コントローラー
2016/8/19 株式会社 リンクバル 22
app > controllers > application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
def hello
render text: "Hello World!!"
end
end
24. HelloWorld
2016/8/19 株式会社 リンクバル 24
config > routes
Rails.application.routes.draw do
# The priority is based upon order of creation:
first created -> highest priority.
# See how all your routes lay out with "rake
routes".
# You can have the root of your site routed with
"root"
# root 'welcome#index'
root 'application#hello'