Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
schedules
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
schedules
Commits
5de61c75
Commit
5de61c75
authored
Apr 12, 2018
by
Zac Wood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added search controller
parent
e76685c0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
0 deletions
+27
-0
schedules/app/assets/javascripts/search.js
schedules/app/assets/javascripts/search.js
+2
-0
schedules/app/assets/stylesheets/search.scss
schedules/app/assets/stylesheets/search.scss
+3
-0
schedules/app/controllers/search_controller.rb
schedules/app/controllers/search_controller.rb
+7
-0
schedules/app/helpers/search_helper.rb
schedules/app/helpers/search_helper.rb
+2
-0
schedules/app/views/search/index.html.erb
schedules/app/views/search/index.html.erb
+2
-0
schedules/config/routes.rb
schedules/config/routes.rb
+2
-0
schedules/test/controllers/search_controller_test.rb
schedules/test/controllers/search_controller_test.rb
+9
-0
No files found.
schedules/app/assets/javascripts/search.js
0 → 100644
View file @
5de61c75
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
schedules/app/assets/stylesheets/search.scss
0 → 100644
View file @
5de61c75
// Place all the styles related to the Search controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
schedules/app/controllers/search_controller.rb
0 → 100644
View file @
5de61c75
class
SearchController
<
ApplicationController
def
index
crn
=
params
[
:crn
]
@sections
=
Section
.
find_by_crn
(
crn
)
render
json:
@sections
end
end
schedules/app/helpers/search_helper.rb
0 → 100644
View file @
5de61c75
module
SearchHelper
end
schedules/app/views/search/index.html.erb
0 → 100644
View file @
5de61c75
<h1>
Search#index
</h1>
<p>
Find me in app/views/search/index.html.erb
</p>
schedules/config/routes.rb
View file @
5de61c75
...
@@ -4,6 +4,8 @@ Rails.application.routes.draw do
...
@@ -4,6 +4,8 @@ Rails.application.routes.draw do
resources
:courses
,
only:
[
:index
]
do
# GET /api/courses
resources
:courses
,
only:
[
:index
]
do
# GET /api/courses
resources
:sections
,
only:
[
:index
]
# GET /api/courses/:course_id/sections
resources
:sections
,
only:
[
:index
]
# GET /api/courses/:course_id/sections
end
end
get
'search'
,
controller:
'search'
,
action:
'index'
end
end
get
'home/index'
get
'home/index'
...
...
schedules/test/controllers/search_controller_test.rb
0 → 100644
View file @
5de61c75
require
'test_helper'
class
SearchControllerTest
<
ActionDispatch
::
IntegrationTest
test
"should get index"
do
get
search_index_url
assert_response
:success
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment