diff --git a/app/controllers/admin/books_controller.rb b/app/controllers/admin/books_controller.rb index dc9319a..d922f57 100644 --- a/app/controllers/admin/books_controller.rb +++ b/app/controllers/admin/books_controller.rb @@ -5,6 +5,7 @@ class Admin::BooksController < OrbitMemberController before_action :set_book, only: [:show, :edit , :update, :destroy] 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_plugin def index @writing_books = Book.all @@ -159,6 +160,10 @@ class Admin::BooksController < OrbitMemberController @plugins = OrbitApp::Plugin::Registration.all rescue nil end + def set_plugin + @plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'Book'}.first + end + def set_types @author_types = BookAuthorType.all @book_types = BookType.all diff --git a/app/models/book.rb b/app/models/book.rb index f91a59b..e3acc54 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -38,7 +38,6 @@ class Book after_save :save_book_files, :save_book_authors - def create_link title = [] title << self.member_profile.name if self.member_profile.present?