Permalink
Browse files

Added a root route and basic root view with timestamp

  • Loading branch information...
dliggat committed Dec 13, 2014
1 parent f59b8f3 commit 521fac60a7ab97e9c7a1fb2c6f54b514dbaa2a44
Showing with 12 additions and 0 deletions.
  1. +10 −0 app/controllers/application_controller.rb
  2. +2 −0 config/routes.rb
@@ -2,4 +2,14 @@ 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 root
render text: <<-EOS
<html>
<body>
<p>Hello from #{request.host}. It is <strong>#{Time.now}</strong>!</p>
</body>
</html>
EOS
end
end
@@ -1,6 +1,8 @@
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 comments on commit 521fac6

Please sign in to comment.