Class: HomeController

Inherits:
ApplicationController show all
Defined in:
app/controllers/home_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::APP_DOMAIN

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #canonical_url, #check_domain, #ensure_domain, #get_notice

Instance Method Details

#aboutObject


11
12
13
# File 'app/controllers/home_controller.rb', line 11

def about
  canonical_url('/about')
end

#changesObject


27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/home_controller.rb', line 27

def changes
  canonical_url('/recent-changes')
  @recent_changes = Rails.cache.fetch('recent_changes_from_github', expires_in: 1.hour) do
    if ENV['HOSPITIUM_GITHUB_TOKEN']
      client = Octokit::Client.new(:access_token => ENV['HOSPITIUM_GITHUB_TOKEN'])
      client.list_commits('ninetwentyfour/Hospitium', branch = 'master', options = {}).map { |commit| {message: commit.commit.message, date: commit.commit.author.date, html_url: commit.html_url }}
    else
      Octokit.list_commits('ninetwentyfour/Hospitium', branch = 'master', options = {}).map { |commit| {message: commit.commit.message, date: commit.commit.author.date, html_url: commit.html_url}}
    end
  end
end

#featuresObject


15
16
17
# File 'app/controllers/home_controller.rb', line 15

def features
  canonical_url('/features')
end

#homeObject


8
9
# File 'app/controllers/home_controller.rb', line 8

def home
end

#indexObject


4
5
6
# File 'app/controllers/home_controller.rb', line 4

def index
  canonical_url('/')
end

#privacyObject


19
20
21
# File 'app/controllers/home_controller.rb', line 19

def privacy
  canonical_url('/privacy-and-terms-of-service')
end

#whyObject


23
24
25
# File 'app/controllers/home_controller.rb', line 23

def why
  canonical_url('/why-hospitium')
end