fixed navigation and breadcrumb for books

This commit is contained in:
Saurabh Bhatia 2014-07-11 10:45:14 +08:00
parent 77fe706f51
commit 298ed923ed
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ class Admin::BooksController < OrbitMemberController
before_action :set_book, only: [:show, :edit , :update, :destroy] before_action :set_book, only: [:show, :edit , :update, :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
def index def index
@writing_books = Book.all @writing_books = Book.all
@ -159,6 +160,10 @@ class Admin::BooksController < OrbitMemberController
@plugins = OrbitApp::Plugin::Registration.all rescue nil @plugins = OrbitApp::Plugin::Registration.all rescue nil
end end
def set_plugin
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'Book'}.first
end
def set_types def set_types
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@book_types = BookType.all @book_types = BookType.all

View File

@ -38,7 +38,6 @@ class Book
after_save :save_book_files, :save_book_authors after_save :save_book_files, :save_book_authors
def create_link def create_link
title = [] title = []
title << self.member_profile.name if self.member_profile.present? title << self.member_profile.name if self.member_profile.present?