Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submissions
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mis21-intersession-2016
submissions
Commits
a714fcb1
Commit
a714fcb1
authored
Jul 13, 2016
by
Bianca Tarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited quiz 2
parent
28c45ecd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
9 deletions
+5
-9
sports_controller.rb
...rmation_system/app/controllers/admin/sports_controller.rb
+2
-2
_form.html.erb
..._information_system/app/views/admin/sports/_form.html.erb
+1
-1
index.html.erb
..._information_system/app/views/admin/sports/index.html.erb
+1
-1
index.html.erb
...sports_information_system/app/views/sports/index.html.erb
+0
-4
routes.rb
144003/quiz 2/sports_information_system/config/routes.rb
+1
-1
No files found.
144003/quiz 2/sports_information_system/app/controllers/admin/sports_controller.rb
View file @
a714fcb1
...
...
@@ -13,7 +13,7 @@ module Admin
def
update
@sport
=
Sport
.
find
(
params
[
:id
])
if
@sport
s
.
update
(
admin_sport_params
())
if
@sport
.
update
(
admin_sport_params
())
redirect_to
admin_sport_path
(
@sport
.
id
)
else
render
"/admin/sports/edit.html.erb"
...
...
@@ -47,7 +47,7 @@ module Admin
redirect_to
admin_sports_path
end
def
sport_params
def
admin_
sport_params
params
.
require
(
:sport
).
permit!
end
...
...
144003/quiz 2/sports_information_system/app/views/admin/sports/_form.html.erb
View file @
a714fcb1
<%=
simple_form_for
(
@sport
)
do
|
f
|
%>
<%=
simple_form_for
(
[
:admin
,
@sport
]
)
do
|
f
|
%>
<%=
f
.
input
:name
%>
<hr>
<%=
f
.
input
:description
%>
...
...
144003/quiz 2/sports_information_system/app/views/admin/sports/index.html.erb
View file @
a714fcb1
...
...
@@ -25,4 +25,4 @@
<%
end
%>
</table>
<hr>
<a
href=
"/pages/index"
>
Back to Homepage
</a>
\ No newline at end of file
<a
href=
"/"
>
Back to Homepage
</a>
\ No newline at end of file
144003/quiz 2/sports_information_system/app/views/sports/index.html.erb
View file @
a714fcb1
<h1>
All User Sports
</h1>
<%=
link_to
(
"New Sport"
,
new_sport_path
)
%>
<hr>
<table
width=
"100%"
>
<tr>
...
...
@@ -18,8 +16,6 @@
<td>
<%=
sport
.
category
%>
</td>
<td>
<%=
link_to
"Show"
,
sport_path
(
sport
.
id
)
%>
<%=
link_to
"Edit"
,
edit_sport_path
(
sport
.
id
)
%>
<%=
link_to
"Delete"
,
sport_path
(
sport
.
id
),
method: :delete
,
data:
{
confirm:
'Are you sure?'
}
%>
</td>
</tr>
<%
end
%>
...
...
144003/quiz 2/sports_information_system/config/routes.rb
View file @
a714fcb1
Rails
.
application
.
routes
.
draw
do
root
to:
"pages#index"
resources
:sports
#, only: [:create,
:index, :show]
resources
:sports
,
only:
[
:index
,
:show
]
namespace
:admin
do
resources
:sports
...
...
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