Module: CadmusFiles::AdminController

Extended by:
ActiveSupport::Concern
Includes:
Cadmus::Concerns::ControllerWithParent
Defined in:
lib/cadmus_files/admin_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
# File 'lib/cadmus_files/admin_controller.rb', line 15

def create
  @cms_file ||= cms_file_scope.new(cms_file_params)
  @cms_file.save!

  redirect_to action: 'index'
end

#destroyObject



22
23
24
25
26
27
# File 'lib/cadmus_files/admin_controller.rb', line 22

def destroy
  @cms_file ||= cms_file_scope.find(params[:id])
  @cms_file.destroy

  redirect_to action: 'index'
end

#indexObject



10
11
12
13
# File 'lib/cadmus_files/admin_controller.rb', line 10

def index
  @cms_files ||= cms_file_scope
  render template: 'cadmus/files/index'
end