Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
102aaf06
Commit
102aaf06
authored
Jun 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use simple render syntax in controllers
parent
edcd4659
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+2
-2
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+2
-2
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+2
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+3
-3
No files found.
app/controllers/admin/groups_controller.rb
View file @
102aaf06
...
@@ -25,7 +25,7 @@ class Admin::GroupsController < Admin::ApplicationController
...
@@ -25,7 +25,7 @@ class Admin::GroupsController < Admin::ApplicationController
if
@group
.
save
if
@group
.
save
redirect_to
[
:admin
,
@group
],
notice:
'Group was successfully created.'
redirect_to
[
:admin
,
@group
],
notice:
'Group was successfully created.'
else
else
render
action:
"new"
render
"new"
end
end
end
end
...
@@ -40,7 +40,7 @@ class Admin::GroupsController < Admin::ApplicationController
...
@@ -40,7 +40,7 @@ class Admin::GroupsController < Admin::ApplicationController
if
@group
.
update_attributes
(
group_params
)
if
@group
.
update_attributes
(
group_params
)
redirect_to
[
:admin
,
@group
],
notice:
'Group was successfully updated.'
redirect_to
[
:admin
,
@group
],
notice:
'Group was successfully updated.'
else
else
render
action:
"edit"
render
"edit"
end
end
end
end
...
...
app/controllers/admin/users_controller.rb
View file @
102aaf06
...
@@ -53,7 +53,7 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -53,7 +53,7 @@ class Admin::UsersController < Admin::ApplicationController
format
.
html
{
redirect_to
[
:admin
,
@admin_user
],
notice:
'User was successfully created.'
}
format
.
html
{
redirect_to
[
:admin
,
@admin_user
],
notice:
'User was successfully created.'
}
format
.
json
{
render
json:
@admin_user
,
status: :created
,
location:
@admin_user
}
format
.
json
{
render
json:
@admin_user
,
status: :created
,
location:
@admin_user
}
else
else
format
.
html
{
render
action:
"new"
}
format
.
html
{
render
"new"
}
format
.
json
{
render
json:
@admin_user
.
errors
,
status: :unprocessable_entity
}
format
.
json
{
render
json:
@admin_user
.
errors
,
status: :unprocessable_entity
}
end
end
end
end
...
@@ -76,7 +76,7 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -76,7 +76,7 @@ class Admin::UsersController < Admin::ApplicationController
else
else
# restore username to keep form action url.
# restore username to keep form action url.
admin_user
.
username
=
params
[
:id
]
admin_user
.
username
=
params
[
:id
]
format
.
html
{
render
action:
"edit"
}
format
.
html
{
render
"edit"
}
format
.
json
{
render
json:
admin_user
.
errors
,
status: :unprocessable_entity
}
format
.
json
{
render
json:
admin_user
.
errors
,
status: :unprocessable_entity
}
end
end
end
end
...
...
app/controllers/merge_requests_controller.rb
View file @
102aaf06
...
@@ -54,7 +54,7 @@ class MergeRequestsController < ProjectResourceController
...
@@ -54,7 +54,7 @@ class MergeRequestsController < ProjectResourceController
@merge_request
.
reload_code
@merge_request
.
reload_code
redirect_to
[
@project
,
@merge_request
],
notice:
'Merge request was successfully created.'
redirect_to
[
@project
,
@merge_request
],
notice:
'Merge request was successfully created.'
else
else
render
action:
"new"
render
"new"
end
end
end
end
...
@@ -64,7 +64,7 @@ class MergeRequestsController < ProjectResourceController
...
@@ -64,7 +64,7 @@ class MergeRequestsController < ProjectResourceController
@merge_request
.
mark_as_unchecked
@merge_request
.
mark_as_unchecked
redirect_to
[
@project
,
@merge_request
],
notice:
'Merge request was successfully updated.'
redirect_to
[
@project
,
@merge_request
],
notice:
'Merge request was successfully updated.'
else
else
render
action:
"edit"
render
"edit"
end
end
end
end
...
...
app/controllers/projects_controller.rb
View file @
102aaf06
...
@@ -27,7 +27,7 @@ class ProjectsController < ProjectResourceController
...
@@ -27,7 +27,7 @@ class ProjectsController < ProjectResourceController
if
@project
.
saved?
if
@project
.
saved?
redirect_to
@project
redirect_to
@project
else
else
render
action:
"new"
render
"new"
end
end
end
end
format
.
js
format
.
js
...
@@ -43,7 +43,7 @@ class ProjectsController < ProjectResourceController
...
@@ -43,7 +43,7 @@ class ProjectsController < ProjectResourceController
format
.
html
{
redirect_to
edit_project_path
(
@project
),
notice:
'Project was successfully updated.'
}
format
.
html
{
redirect_to
edit_project_path
(
@project
),
notice:
'Project was successfully updated.'
}
format
.
js
format
.
js
else
else
format
.
html
{
render
action:
"edit"
,
layout:
"project_settings"
}
format
.
html
{
render
"edit"
,
layout:
"project_settings"
}
format
.
js
format
.
js
end
end
end
end
...
@@ -90,7 +90,7 @@ class ProjectsController < ProjectResourceController
...
@@ -90,7 +90,7 @@ class ProjectsController < ProjectResourceController
redirect_to
(
@forked_project
,
notice:
'Project was successfully forked.'
)
redirect_to
(
@forked_project
,
notice:
'Project was successfully forked.'
)
else
else
@title
=
'Fork project'
@title
=
'Fork project'
render
action:
"fork"
render
"fork"
end
end
end
end
format
.
js
format
.
js
...
...
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