From 3e27cf92632ffdb0f7b02dbc7781229ec82bd207 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 27 Feb 2014 19:44:29 -0700 Subject: add a homepage to display the different types of routes. --- app/controllers/home_controller.rb | 6 +++++ app/views/home/index.html.erb | 45 ++++++++++++++++++++++++++++++++++++++ config/routes.rb | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 app/controllers/home_controller.rb create mode 100644 app/views/home/index.html.erb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..a7d44f1 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,6 @@ +class HomeController < ApplicationController + def index + @licenses = License.all + @companies = Company.all + end +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..154d340 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,45 @@ + + + + + + + +

oh hai

+<%= link_to "all licenses", v1_licenses_path %> + +

Licenses

+ + +

Companies

+ + + diff --git a/config/routes.rb b/config/routes.rb index 39fc8ea..cc8a846 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,5 +5,5 @@ CodeChallengeMo::Application.routes.draw do resources :licenses, controller: 'company_licenses', only: [:index] end end - root to: 'v1/licenses#index' + root to: 'home#index' end -- cgit v1.2.3