登录问题

dev_aliyun
jingquan huang 6 years ago
parent 4ef7094812
commit 1db7bde85c

@ -1,7 +1,7 @@
class LibrariesController < ApplicationController
layout 'base_library'
before_filter :require_login, :except => [:index]
before_filter :require_login, :except => [:index, :show]
after_filter :increment_visit_count, only: [:show, :create, :edit, :update]
def index
@ -121,7 +121,7 @@ class LibrariesController < ApplicationController
end
def admin_or_self?
current_library.user_id == current_user.id || admin_or_business?
current_library.try(:user_id) == current_user.try(:id) || admin_or_business?
end
def increment_visit_count

Loading…
Cancel
Save