rubocop corrections

This commit is contained in:
Karol Selak 2021-03-22 03:16:29 +01:00
parent c63c6bc448
commit de29815686
72 changed files with 468 additions and 311 deletions

View file

@ -1,6 +1,9 @@
# frozen_string_literal: true
# Authors controller
class AuthorsController < ApplicationController
before_action :ensure_admin
before_action :set_author, only: [:edit, :update]
before_action :set_author, only: %i[edit update]
def index
@authors = Author.all
@ -11,9 +14,7 @@ class AuthorsController < ApplicationController
end
def update
if @author.update(author_params)
redirect_to '/authors'
end
redirect_to '/authors' if @author.update(author_params)
end
private