Class: Manage::ResourceController
Instance Method Summary
collapse
#auth_user!, #current_user
Instance Method Details
#create ⇒ Object
30
31
32
33
34
35
|
# File 'app/controllers/manage/resource_controller.rb', line 30
def create
create!(:notice => "New #{resource_class} created!") do |success, failure|
success.html { redirect_to action: :index }
failure.html { render :action => :edit and return }
end
end
|
#destroy ⇒ Object
44
45
46
47
48
|
# File 'app/controllers/manage/resource_controller.rb', line 44
def destroy
destroy!(:notice => "#{resource_class} deleted!") do |format|
format.html { redirect_to action: :index }
end
end
|
#end_of_association_chain ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/manage/resource_controller.rb', line 20
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_help ⇒ Object
50
51
|
# File 'app/controllers/manage/resource_controller.rb', line 50
def show_help
end
|
#update ⇒ Object
37
38
39
40
41
42
|
# File 'app/controllers/manage/resource_controller.rb', line 37
def update
update!(:notice => "#{resource_class} updated!") do |success, failure|
success.html { redirect_to action: :index }
failure.html { render :action => :edit and return }
end
end
|