Class: Katello::Api::V2::ContentViewFiltersController
Constant Summary
Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
Instance Method Summary
collapse
#auto_complete_search
#full_result_response, #resource_class, #scoped_search
Methods included from Rendering
#respond_for_async, #respond_for_bulk_async, #respond_for_create, #respond_for_destroy, #respond_for_index, #respond_for_show, #respond_for_status, #respond_for_update, #respond_with_template, #respond_with_template_collection, #respond_with_template_resource, #try_specific_collection_template, #try_specific_resource_template
#api_version
Instance Method Details
#create ⇒ Object
35
36
37
38
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 35
def create
filter = ContentViewFilter.create_for(params[:type], filter_params.merge(:content_view => @view))
respond :resource => filter
end
|
#destroy ⇒ Object
66
67
68
69
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 66
def destroy
@filter.destroy
respond_for_show :resource => @filter
end
|
#index ⇒ Object
15
16
17
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 15
def index
respond(:collection => scoped_search(index_relation.uniq, :name, :asc))
end
|
#index_relation ⇒ Object
19
20
21
22
23
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 19
def index_relation
query = ContentViewFilter.where(:content_view_id => (@view || ContentView.readable))
query = query.where(:name => params[:name]) if params[:name]
query
end
|
#show ⇒ Object
44
45
46
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 44
def show
respond :resource => @filter
end
|
#update ⇒ Object
57
58
59
60
|
# File 'app/controllers/katello/api/v2/content_view_filters_controller.rb', line 57
def update
@filter.update_attributes!(filter_params)
respond :resource => @filter
end
|