Commit 102aaf06 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use simple render syntax in controllers

parent edcd4659
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
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