Class: Admin::FacultySponsorsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/faculty_sponsors_controller.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#createObject


21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 21

def create
  @faculty_sponsor = FacultySponsor.new(params[:faculty_sponsor])

  respond_to do |format|
    if @faculty_sponsor.save
      flash[:notice] = 'Faculty Sponsor was successfully created.'
      format.html { redirect_to(admin_faculty_sponsors_path) }
    else
      format.html { render action: 'new' }
    end
  end
end

#destroyObject


45
46
47
48
49
50
51
52
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 45

def destroy
  @faculty_sponsor.destroy

  respond_to do |format|
    flash[:notice] = 'Faculty Sponsor was successfully deleted.'
    format.html { redirect_to(admin_faculty_sponsors_path) }
  end
end

#editObject


19
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 19

def edit; end

#indexObject


9
10
11
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 9

def index
  @faculty_sponsors = FacultySponsor.all
end

#newObject


15
16
17
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 15

def new
  @faculty_sponsor = FacultySponsor.new
end

#showObject


13
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 13

def show; end

#updateObject


34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/admin/faculty_sponsors_controller.rb', line 34

def update
  respond_to do |format|
    if @faculty_sponsor.update(params[:faculty_sponsor])
      flash[:notice] = 'Faculty Sponsor was successfully updated.'
      format.html { redirect_to(admin_faculty_sponsors_path) }
    else
      format.html { render action: 'edit' }
    end
  end
end