Sha256: c310816bf6c0ad750c6ea84cdb036ac3f99db136732a497db6e10c6d869a2114

Contents?: true

Size: 299 Bytes

Versions: 8

Compression:

Stored size: 299 Bytes

Contents

module Oxen
  module ApplicationHelper
    def is_login?
      !!session[:login]
    end

    def need_login
      unless is_login?
        flash[:alert] = "需要登录"
        redirect_to login_path and return
      end
    end

    def is_root?
      session[:login] == "root"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
oxen-0.0.9 app/helpers/oxen/application_helper.rb
oxen-0.0.7 app/helpers/oxen/application_helper.rb
oxen-0.0.6 app/helpers/oxen/application_helper.rb
oxen-0.0.5 app/helpers/oxen/application_helper.rb
oxen-0.0.4 app/helpers/oxen/application_helper.rb
oxen-0.0.3 app/helpers/oxen/application_helper.rb
oxen-0.0.2 app/helpers/oxen/application_helper.rb
oxen-0.0.1 app/helpers/oxen/application_helper.rb