Module: GrpcAuth::ApplicationOnly

Defined in:
app/helpers/grpc_auth/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#need_loginObject



11
12
13
14
15
16
# File 'app/helpers/grpc_auth/application_helper.rb', line 11

def 
  unless is_login?
    flash[:alert] = "你还没有登录"
    redirect_to grpc_auth. and return
  end
end

#pageitObject



18
19
20
21
22
# File 'app/helpers/grpc_auth/application_helper.rb', line 18

def pageit
  params[:page] ||= 1   
  per_page = 10
  @num=per_page*(params[:page].to_i-1)
end