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



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

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

#destroyObject



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

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
25
# 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(clean_search_params(params[:f]))

  @search.results
end

#show_helpObject



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

def show_help
end

#updateObject



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

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