Class: Pageflow::ExternalLinks::SitesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/pageflow/external_links/sites_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
# File 'app/controllers/pageflow/external_links/sites_controller.rb', line 12

def create
  @entry = Entry.find(params[:entry_id])
  site = Site.all_for_revision(@entry.draft).create!(site_params)

  respond_with(site)
end

#destroyObject



26
27
28
29
30
31
# File 'app/controllers/pageflow/external_links/sites_controller.rb', line 26

def destroy
  site = Site.find(params[:id])
  site.destroy

  respond_with(site)
end

#indexObject



6
7
8
9
10
# File 'app/controllers/pageflow/external_links/sites_controller.rb', line 6

def index
  @entry = Entry.find(params[:entry_id])

  respond_with(Site.all_for_revision(@entry.draft))
end

#updateObject



19
20
21
22
23
24
# File 'app/controllers/pageflow/external_links/sites_controller.rb', line 19

def update
  site = Site.find(params[:id])
  site.update(site_params)

  respond_with(site)
end