From bb4571582c2a14dcd5eaba4a885dd38e6fde6d50 Mon Sep 17 00:00:00 2001 From: Rebecca Kleinberg Date: Sat, 10 Oct 2015 16:00:33 -0400 Subject: [PATCH] add route / to point to views/index --- app/controllers/index.rb | 3 +++ app/models/survey.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 app/controllers/index.rb diff --git a/app/controllers/index.rb b/app/controllers/index.rb new file mode 100644 index 0000000..89cb2a3 --- /dev/null +++ b/app/controllers/index.rb @@ -0,0 +1,3 @@ +get '/' do + redirect '/index' +end \ No newline at end of file diff --git a/app/models/survey.rb b/app/models/survey.rb index 52699b9..0337651 100644 --- a/app/models/survey.rb +++ b/app/models/survey.rb @@ -2,7 +2,7 @@ class Survey < ActiveRecord::Base belongs_to :author, class_name: "User" has_many :questions has_many :responses - has_many :respondants, through: :responses, source: :user + has_many :respondants, through: :responses, source: :key => "value", user validates :author_id, :title, presence: true end