Class: Backend::BaseHelper::BasicCalendar

Inherits:
SimpleCalendar::MonthCalendar
  • Object
show all
Defined in:
app/helpers/backend/base_helper.rb

Overview

BasicCalendar permits to fix some SimpleCalendar issues with param name and partial.

Instance Method Summary collapse

Instance Method Details

#date_param_nameObject


69
70
71
# File 'app/helpers/backend/base_helper.rb', line 69

def date_param_name
  @options[:param_name] ||= :start_date
end

#paramsObject


73
74
75
# File 'app/helpers/backend/base_helper.rb', line 73

def params
  @options[:params] ||= {}
end

#partial_nameObject

Overwrite default partial name


65
66
67
# File 'app/helpers/backend/base_helper.rb', line 65

def partial_name
  @options[:partial] || 'backend/shared/month_calendar'
end

#start_dateObject


77
78
79
# File 'app/helpers/backend/base_helper.rb', line 77

def start_date
  view_context.params.fetch(date_param_name, Date.today).to_date
end