Sha256: f0351b89138b9f3a7c6fadfff7b183366934912cae006a83e1e4564c9bd37650

Contents?: true

Size: 399 Bytes

Versions: 5

Compression:

Stored size: 399 Bytes

Contents

class Admin::BaseController < ApplicationController
  before_filter :require_admin
  helper :admin_base

  def index
  end

  def reports
  end

  protected
  def redirect_unless_monday(path_prefix, date)
    @start_date = date ? Date.parse(date) : Date.current
    unless @start_date.wday == 1 #Monday
      redirect_to(path_prefix + @start_date.beginning_of_week.strftime("%F"))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xrono-1.0.4 app/controllers/admin/base_controller.rb
xrono-1.0.3 app/controllers/admin/base_controller.rb
xrono-1.0.2 app/controllers/admin/base_controller.rb
xrono-1.0.1 app/controllers/admin/base_controller.rb
xrono-1.0.0 app/controllers/admin/base_controller.rb