Class: Admin::WidgetsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/admin/widgets_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/admin/widgets_controller.rb', line 16

def destroy
  if request.delete?
    @widget.destroy
    flash[:notice] = I18n.t('widget.destroy.success').capitalize
  else
    flash[:error] = @widget.errors if @widget
    flash[:error] = I18n.t('widget.destroy.failed').capitalize
  end
  render :nothing => true
end

#indexObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/admin/widgets_controller.rb', line 6

def index
  respond_to do |format|
    format.html
    format.json do
      sort
      render :layout => false
    end
  end
end