Class: Admin::EmbeddableHostsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
# File 'app/controllers/admin/embeddable_hosts_controller.rb', line 4

def create
  save_host(EmbeddableHost.new, :create)
end

#destroyObject



13
14
15
16
17
18
19
20
21
# File 'app/controllers/admin/embeddable_hosts_controller.rb', line 13

def destroy
  host = EmbeddableHost.where(id: params[:id]).first
  host.destroy
  StaffActionLogger.new(current_user).log_embeddable_host(
    host,
    UserHistory.actions[:embeddable_host_destroy],
  )
  render json: success_json
end

#updateObject



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

def update
  host = EmbeddableHost.where(id: params[:id]).first
  save_host(host, :update)
end