We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f59b8f3 commit 521fac6Copy full SHA for 521fac6
2 files changed
app/controllers/application_controller.rb
@@ -2,4 +2,14 @@ class ApplicationController < ActionController::Base
2
# Prevent CSRF attacks by raising an exception.
3
# For APIs, you may want to use :null_session instead.
4
protect_from_forgery with: :exception
5
+
6
+ def root
7
+ render text: <<-EOS
8
+ <html>
9
+ <body>
10
+ <p>Hello from #{request.host}. It is <strong>#{Time.now}</strong>!</p>
11
+ </body>
12
+ </html>
13
+ EOS
14
+ end
15
end
config/routes.rb
@@ -1,6 +1,8 @@
1
Rails.application.routes.draw do
resources :posts
+ root to: 'application#root'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
0 commit comments