Class: Manage::ResourceController

Inherits:
ApplicationController show all
Defined in:
app/controllers/manage/resource_controller.rb

Direct Known Subclasses

AdminUsersController

Instance Method Summary collapse

Methods inherited from ApplicationController

#auth_user!, #current_user

Instance Method Details

#createObject



26
27
28
29
30
# File 'app/controllers/manage/resource_controller.rb', line 26

def create
  create!(:notice => "New #{resource_class} created!") do |format|
    format.html { redirect_to action: :index }
  end
end

#destroyObject



38
39
40
41
42
# File 'app/controllers/manage/resource_controller.rb', line 38

def destroy
  destroy!(:notice => "#{resource_class} deleted!") do |format|
    format.html { redirect_to action: :index }
  end
end

#end_of_association_chainObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/manage/resource_controller.rb', line 16

def end_of_association_chain
  if self.resources_configuration[:self][:search_fields].blank?
    self.class.search_fields :all
  end

  config = self.resources_configuration[:self]
  @search = config[:search].new(filters: clean_search_params(params[:f]))
  @search.results
end

#show_helpObject



44
45
# File 'app/controllers/manage/resource_controller.rb', line 44

def show_help
end

#updateObject



32
33
34
35
36
# File 'app/controllers/manage/resource_controller.rb', line 32

def update
  update!(:notice => "#{resource_class} updated!") do |format|
    format.html { redirect_to action: :index }
  end
end