我承認我不完全知道爲什麼之前的過濾器是(或者即使它是)處理我的問題的最佳方式,但是有一位開發人員告訴我,這個開發人員比我對Rails編程知道得多。所以我會試着讓它工作! 所以我試圖做的是檢查數據庫中的最新圖書是否在7天前或更多時間創建,如果是,則創建一個新圖書。 這裏是我的書控制器目前的樣子: class BooksController < ApplicationController
b
我正在建立一個學校系統,教員可以在各自學校範圍內管理教室。 我有以下能力的設置相匹配: class Ability
include CanCan::Ability
#define the user ability
def initialize(user)
user ||= User.new # guest user (not logged in)
在application_controller.rb我有以下: before_filter :get_events
before_filter :get_sitemap
def login_required
return true if session[:user]
# If we get to this point, I want to avoid running get
我有一個瘋狂的問題,只有在生產中發生。我不能在開發中複製它。 因爲我有以下設置各種原因: class OrdersController < PublicController
class PublicController < CommonController
class CommonController < ApplicationController
裏面的CommonController我