Class: SummerResidents::FamilyForeignKeysController

Inherits:
SummerResidentsController show all
Defined in:
app/controllers/summer_residents/family_foreign_keys_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
# File 'app/controllers/summer_residents/family_foreign_keys_controller.rb', line 16

def create
  create_and_assign_to_family
  assign_attributes
  show_unless_errors
end

#destroyObject



28
29
30
31
32
33
34
# File 'app/controllers/summer_residents/family_foreign_keys_controller.rb', line 28

def destroy
  model_name.find(params[:id]).destroy
  
  respond_to do |format|
    format.js { render nothing: true }
  end
end

#editObject



11
12
13
14
# File 'app/controllers/summer_residents/family_foreign_keys_controller.rb', line 11

def edit
  @instance = model_name.find(params[:id])
  edit_but_if_cancelled :show
end

#newObject



6
7
8
9
# File 'app/controllers/summer_residents/family_foreign_keys_controller.rb', line 6

def new
  create_and_assign_to_family
  edit_but_if_cancelled :blank
end

#updateObject



22
23
24
25
26
# File 'app/controllers/summer_residents/family_foreign_keys_controller.rb', line 22

def update
  @instance = model_name.find(params[:id])
  assign_attributes
  show_unless_errors
end