From 298ed923ed57b9177f2cc756937b85c5d008e775 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Fri, 11 Jul 2014 10:45:14 +0800 Subject: [PATCH] fixed navigation and breadcrumb for books --- app/controllers/admin/books_controller.rb | 5 +++++ app/models/book.rb | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) 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?