This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/active_admin_dsl.rb | |
require 'active_admin/dsl.rb' | |
include CollectiveIdea::Acts::NestedSet::Helper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
ActiveAdmin::Views::Pages::Base.class_eval do | |
private | |
# Renders the content for the footer | |
def build_footer | |
div :id => "footer" do | |
para "Copyright © #{Date.today.year.to_s} #{link_to('Example.com', 'http://example.com')}. Powered by #{link_to('Active Admin', 'http://www.activeadmin.info')} #{ActiveAdmin::VERSION}".html_safe | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 引入文件 | |
# require 'mongoid/activity' | |
## 插入Document行後 | |
# include Mongoid::Activity::Trackable | |
# 啟用跟蹤 | |
# tracking :person => :follower, :scope => :followable, :create_bones => 5, :destroy_bones => -3 | |
module Mongoid | |
module Activity | |
module Trackable | |
extend ActiveSupport::Concern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 引入文件 | |
# require 'mongoid/counter_cache' | |
## 插入Document行後 | |
# include Mongoid::Relations::CounterCache | |
## 默認 | |
# referenced_in :person, :inverse_of => :posts, :counter_cache => true | |
## 自定義 | |
# referenced_in :person, :inverse_of => :posts, :counter_cache => :posts_count | |
module Mongoid |
NewerOlder