Class: AdminController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/flexible_admin/templates/admin_controller.rb

Direct Known Subclasses

Admin::ResourcesController

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
# File 'lib/generators/flexible_admin/templates/admin_controller.rb', line 4

def index
end

#toggleObject



7
8
9
10
11
12
# File 'lib/generators/flexible_admin/templates/admin_controller.rb', line 7

def toggle
  @resource = resource
  @resource.toggle(params[:field])
  @resource.save
  redirect_to :back, :notice => "#{resource.class.to_s} successfully updated"
end