Skip to content

Commit

Permalink
Added a root route and basic root view with timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
dliggat committed Dec 13, 2014
1 parent f59b8f3 commit 521fac6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -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
2 changes: 2 additions & 0 deletions config/routes.rb
@@ -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".

Expand Down

0 comments on commit 521fac6

Please sign in to comment.