Class: Admin::TeamMembersController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/c/admin/team_members_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

[View source]

17
18
19
20
21
22
23
# File 'app/controllers/c/admin/team_members_controller.rb', line 17

def create
  if @team_member.save
    redirect_to team_members_path, notice: 'Team Member created'
  else
    render :new
  end
end

#dashboardObject

[View source]

33
# File 'app/controllers/c/admin/team_members_controller.rb', line 33

def dashboard; end

#destroyObject

[View source]

35
36
37
38
39
40
41
# File 'app/controllers/c/admin/team_members_controller.rb', line 35

def destroy
  @team_member.destroy
  respond_to do |format|
    format.js
    format.html { redirect_to team_members_path }
  end
end

#editObject

[View source]

15
# File 'app/controllers/c/admin/team_members_controller.rb', line 15

def edit; end

#indexObject

[View source]

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

def index
  @team_members
end

#newObject

[View source]

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

def new; end

#sortObject

[View source]

43
44
45
46
47
48
49
# File 'app/controllers/c/admin/team_members_controller.rb', line 43

def sort
  @team_members = C::TeamMember.all
  @team_members.update_order(params[:team_member])
  respond_to do |format|
    format.js { head :ok, content_type: 'text/html' }
  end
end

#updateObject

[View source]

25
26
27
28
29
30
31
# File 'app/controllers/c/admin/team_members_controller.rb', line 25

def update
  if @team_member.update(team_member_params)
    redirect_to team_members_path, notice: 'Team Member updated'
  else
    render :edit
  end
end