This commit is contained in:
21
app/controllers/books/publications_controller.rb
Normal file
21
app/controllers/books/publications_controller.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class Books::PublicationsController < ApplicationController
|
||||
include BookScoped
|
||||
|
||||
before_action :ensure_editable, only: %i[ edit update ]
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
@book.update! book_params
|
||||
redirect_to book_slug_url(@book)
|
||||
end
|
||||
|
||||
private
|
||||
def book_params
|
||||
params.require(:book).permit(:published, :slug)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user