Class: Backend::EventsController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/events_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_theme

Instance Method Summary collapse

Methods inherited from BaseController

account_lettering_states_crit, accounts_range_crit, amount_range_crit, crit_params, journal_entries_states_crit, journal_letter_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name, #session_controller?

Instance Method Details

#change_minutesObject


44
45
46
47
48
# File 'app/controllers/backend/events_controller.rb', line 44

def change_minutes
  return unless nature = Nomen::EventNature[params[:nature]]
  value = nature.send(params[:field] || :name)
  render text: value.to_s, layout: false
end

#indexObject


38
39
40
41
42
# File 'app/controllers/backend/events_controller.rb', line 38

def index
  started_on = (params[:started_on] ? Time.new(*params[:started_on].split('-')) : Time.zone.now)
  @events = Event.between(started_on.beginning_of_month.beginning_of_week, started_on.end_of_month.end_of_week).includes(participations: [:participant])
  render partial: 'month' if request.xhr? && params[:started_on]
end