Commit 6eef2c3e authored by Zac Wood's avatar Zac Wood

Added home controller, reorganized routes

parent 20168e6a
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
// Place all the styles related to the Home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class HomeController < ApplicationController
def index
end
end
<h1>Schedules</h1>
<input type="text" title="search_text" placeholder="Enter CRN..."/>
<button title="search">Search</button>
<h2>Your classes</h2>
<table>
<tr>
<th>Course</th>
<th>Section Name</th>
<th>CRN</th>
<th>Professor</th>
<th>Location</th>
<th>Days</th>
<th>Times</th>
</tr>
</table>
<button title="export">Export to calender</button>
# Registers all routes for the app.
Rails.application.routes.draw do
resources :courses, only: [:index] do
resources :sections, only: [:index]
scope :api do # Register /api routes
resources :courses, only: [:index] do # GET /api/courses
resources :sections, only: [:index] # GET /api/courses/:course_id/sections
end
end
root 'courses#index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
get 'home/index'
root 'home#index' # Set the root to be the home index
end
require 'test_helper'
class HomeControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get home_index_url
assert_response :success
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment