Class: Portfolio::Admin::SiteMenuLinksController

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

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
27
28
29
30
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 22

def create
  @site_menu_link = SiteMenuLink.new(site_menu_link_params)

  if @site_menu_link.save
    redirect_to [:admin, @site, :site_menu_links], notice: 'Item menu link was successfully created.'
  else
    render :new
  end
end

#destroyObject



40
41
42
43
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 40

def destroy
  @site_menu_link.destroy
  redirect_to [:admin, @site, :site_menu_links], notice: 'Item menu link was successfully destroyed.'
end

#editObject



19
20
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 19

def edit
end

#indexObject



8
9
10
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 8

def index
  @site_menu_links = @site.site_menu_links.all
end

#newObject



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

def new
  @site_menu_link = SiteMenuLink.new site: @site
end

#showObject



12
13
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 12

def show
end

#updateObject



32
33
34
35
36
37
38
# File 'app/controllers/portfolio/admin/site_menu_links_controller.rb', line 32

def update
  if @site_menu_link.update(site_menu_link_params)
    redirect_to [:admin, @site, :site_menu_links], notice: 'Item menu link was successfully updated.'
  else
    render :edit
  end
end