使用 helper 方法產生可追蹤的外部連結:
external_link_to("文字", url)
external_link_to(image_tag(圖片), url)
參數控制::new_window、:show_only_if_link、:show_link_icon。設定 $USE_EXTERNAL_LINK_POPUPS = true 啟用彈出視窗。所有點擊記錄儲存於 external_link_logs 資料表。
# config/production.rb
config.action_controller.perform_caching = true
config.cache_store = :mem_cache_store, '10.0.0.1:11211', '10.0.0.2:11211'
$CACHE_CLEAR_IN_HOURS 調整)- taxon_id - language - expertise level - vetted/all - default taxonomic browser - curator for page
# HTTP 端點
GET /expire_all
GET /expire_taxon/TAXON_ID
GET /expire_taxa?taxa_ids=ID1,ID2,ID3
GET /clear_caches
# 程式碼呼叫
expire_all
expire_taxon(taxon_id)
expire_taxa([id1, id2])
clear_all_caches
管理 CSS/JS 合併壓縮,配置 config/asset_packager.yml 按載入順序列出檔案。
# 更新資源後執行
rake asset:packager:build_all
# 開發模式強制合併(測試用)
Synthesis::AssetPackage.merge_environments = ["development", "production"]
生產部署時已整合於 Capistrano 流程。
# 1. 透過 ConceptID 查分類
t = TaxonConcept.find(101)
# 2. 查詢層級項目
he_all = t.hierarchy_entries
he = t.entry # 預設
# 3. 查詢層級與代理資訊
h = he_all[0].hierarchy
h.label, h.agent.full_name, h.agent.homepage, h.agent.logo_cache_url
# 4. 批次查詢代理
agents = he_all[0].agents
agents.each { |a| puts a.full_name + " " + a.homepage + " " + a.logo_cache_url }
template=`allison --path`
rake doc:reapp
