Class: Refinery::RaceRegistrations::Admin::PeopleController

Inherits:
AdminController
  • Object
show all
Includes:
PeopleHelper
Defined in:
app/controllers/refinery/race_registrations/admin/people_controller.rb

Instance Method Summary collapse

Methods included from PeopleHelper

#sort_column, #sort_direction, #sortable

Instance Method Details

#createObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/refinery/race_registrations/admin/people_controller.rb', line 20

def create
  @categories = Category.all

  @person = Person.new(person_params)
  @person.bypass_humanizer = true


  if @person.save
    flash.notice = t(
        'refinery.crudify.created',
        :what => @person.surname
    )

    find_all_people
    render :edit
  else
    render :action => 'new'
  end

end

#editObject



41
42
43
44
# File 'app/controllers/refinery/race_registrations/admin/people_controller.rb', line 41

def edit
  # @person comes from crud before_filter
  @categories = Registration.find(@person.registration_id).categories
end

#newObject



15
16
17
18
# File 'app/controllers/refinery/race_registrations/admin/people_controller.rb', line 15

def new
  @person = Person.new
  @categories = Category.all
end