Class: Portfolio::Admin::SocialLinksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/portfolio/admin/social_links_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
24
25
26
27
28
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 20

def create
  @social_link = SocialLink.new(social_link_params)

  if @social_link.save
    redirect_to [:admin, :social_links], notice: 'Social link was successfully created.'
  else
    render :new
  end
end

#destroyObject



38
39
40
41
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 38

def destroy
  @social_link.destroy
  redirect_to [:admin, :social_links], notice: 'Social link was successfully destroyed.'
end

#editObject



17
18
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 17

def edit
end

#indexObject



6
7
8
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 6

def index
  @social_links = SocialLink.all
end

#newObject



13
14
15
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 13

def new
  @social_link = SocialLink.new
end

#showObject



10
11
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 10

def show
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/portfolio/admin/social_links_controller.rb', line 30

def update
  if @social_link.update(social_link_params)
    redirect_to [:admin, :social_links], notice: 'Social link was successfully updated.'
  else
    render :edit
  end
end