Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
3d35407c
Commit
3d35407c
authored
3 years ago
by
Arnaud Levy
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
e7aed860
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/server/languages_controller.rb
+6
-6
6 additions, 6 deletions
app/controllers/server/languages_controller.rb
app/controllers/server/universities_controller.rb
+12
-23
12 additions, 23 deletions
app/controllers/server/universities_controller.rb
with
18 additions
and
29 deletions
app/controllers/server/languages_controller.rb
+
6
−
6
View file @
3d35407c
...
...
@@ -19,27 +19,27 @@ class Server::LanguagesController < Server::ApplicationController
end
def
create
breadcrumb
if
@language
.
save
redirect_to
@language
,
notice:
"Language was successfully created."
redirect_to
[
:server
,
@language
]
,
notice:
"Language was successfully created."
else
breadcrumb
render
:new
,
status: :unprocessable_entity
end
end
def
update
breadcrumb
add_breadcrumb
'Modifier'
if
@language
.
update
(
language_params
)
redirect_to
@language
,
notice:
"Language was successfully updated."
redirect_to
[
:server
,
@language
]
,
notice:
"Language was successfully updated."
else
breadcrumb
add_breadcrumb
'Modifier'
render
:edit
,
status: :unprocessable_entity
end
end
def
destroy
@language
.
destroy
redirect_to
languages_url
,
notice:
"Language was successfully destroyed."
redirect_to
server_
languages_url
,
notice:
"Language was successfully destroyed."
end
protected
...
...
This diff is collapsed.
Click to expand it.
app/controllers/server/universities_controller.rb
+
12
−
23
View file @
3d35407c
...
...
@@ -19,38 +19,27 @@ class Server::UniversitiesController < Server::ApplicationController
end
def
create
breadcrumb
respond_to
do
|
format
|
if
@university
.
save
format
.
html
{
redirect_to
[
:server
,
@university
],
notice:
"University was successfully created."
}
format
.
json
{
render
:show
,
status: :created
,
location:
[
:server
,
@university
]
}
else
format
.
html
{
render
:new
,
status: :unprocessable_entity
}
format
.
json
{
render
json:
@university
.
errors
,
status: :unprocessable_entity
}
end
if
@university
.
save
redirect_to
[
:server
,
@university
],
notice:
"University was successfully created."
else
breadcrumb
render
:new
,
status: :unprocessable_entity
end
end
def
update
breadcrumb
add_breadcrumb
'Modifier'
respond_to
do
|
format
|
if
@university
.
update
(
university_params
)
format
.
html
{
redirect_to
[
:server
,
@university
],
notice:
"University was successfully updated."
}
format
.
json
{
render
:show
,
status: :ok
,
location:
[
:server
,
@university
]
}
else
format
.
html
{
render
:edit
,
status: :unprocessable_entity
}
format
.
json
{
render
json:
@university
.
errors
,
status: :unprocessable_entity
}
end
if
@university
.
update
(
university_params
)
redirect_to
[
:server
,
@university
],
notice:
"University was successfully updated."
else
breadcrumb
add_breadcrumb
'Modifier'
render
:edit
,
status: :unprocessable_entity
end
end
def
destroy
@university
.
destroy
respond_to
do
|
format
|
format
.
html
{
redirect_to
server_universities_url
,
notice:
"University was successfully destroyed."
}
format
.
json
{
head
:no_content
}
end
redirect_to
server_universities_url
,
notice:
"University was successfully destroyed."
end
protected
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment