desktop fix book cant delete
This commit is contained in:
parent
198a9f503a
commit
3f56689240
|
@ -2,7 +2,8 @@ class Admin::BooksController < OrbitMemberController
|
||||||
include Admin::BooksHelper
|
include Admin::BooksHelper
|
||||||
layout "member_plugin"
|
layout "member_plugin"
|
||||||
|
|
||||||
before_action :set_book, only: [:show, :edit , :update, :destroy]
|
before_action :set_book, only: [:show, :edit , :update]
|
||||||
|
before_action :find_book, only: [:destroy]
|
||||||
before_action :get_plugins, only: [:index, :book_setting, :new, :create, :edit, :update]
|
before_action :get_plugins, only: [:index, :book_setting, :new, :create, :edit, :update]
|
||||||
before_action :set_types, only: [:index,:book_setting, :new, :edit, :create, :update]
|
before_action :set_types, only: [:index,:book_setting, :new, :edit, :create, :update]
|
||||||
before_action :set_plugin
|
before_action :set_plugin
|
||||||
|
@ -156,6 +157,10 @@ class Admin::BooksController < OrbitMemberController
|
||||||
@book = Book.find_by(uid: uid)
|
@book = Book.find_by(uid: uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_book
|
||||||
|
@book = Book.find_by(id: params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
def book_attributes
|
def book_attributes
|
||||||
params.require(:book).permit! rescue nil
|
params.require(:book).permit! rescue nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue