Skip to content

Commit

Permalink
Remove unnecessary render calls
Browse files Browse the repository at this point in the history
Rails will render the appropriate view by default, so there's no need to
 call render from within the controller action method to render the
 default view.

In `confirm_destroy`, the return is unnecessary now that there is no
 more code after the potential redirect.
  • Loading branch information
mtaylorgds committed Nov 1, 2023
1 parent 802b18f commit a292fdb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/controllers/admin/document_collection_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ def index
:non_whitehall_link,
],
)

render :index
end

def show; end

def new
@group = @collection.groups.build
render :new
end

def create
Expand All @@ -33,9 +30,7 @@ def create
end
end

def edit
render :edit
end
def edit; end

def update
@group.update!(document_collection_group_params)
Expand Down Expand Up @@ -65,9 +60,7 @@ def destroy
end

def confirm_destroy
redirect_to admin_document_collection_groups_path(@collection) and return unless @collection.groups.many?

render :confirm_destroy
redirect_to admin_document_collection_groups_path(@collection) unless @collection.groups.many?
end

private
Expand Down

0 comments on commit a292fdb

Please sign in to comment.