[refs #861] move products list to platform
This commit is contained in:
parent
94401d4494
commit
36b258d2a0
|
@ -3,13 +3,7 @@ class Api::V1::ProductsController < Api::V1::BaseController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
skip_before_filter :authenticate_user!, :only => [:index, :show] if APP_CONFIG['anonymous_access']
|
skip_before_filter :authenticate_user!, :only => [:index, :show] if APP_CONFIG['anonymous_access']
|
||||||
|
|
||||||
load_and_authorize_resource :platform, :only => :index
|
load_and_authorize_resource
|
||||||
#load_and_authorize_resource :product, :through => :platform, :only => :index
|
|
||||||
load_and_authorize_resource :only => [:show, :edit, :update, :destroy, :create]
|
|
||||||
|
|
||||||
def index
|
|
||||||
@products = @platform.products.paginate(paginate_params)
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
create_subject @product
|
create_subject @product
|
||||||
|
|
|
@ -8,4 +8,7 @@ json.platform do |json|
|
||||||
json_repos.(repo, :id, :name)
|
json_repos.(repo, :id, :name)
|
||||||
json_repos.url api_v1_repository_path(repo.id, :format => :json)
|
json_repos.url api_v1_repository_path(repo.id, :format => :json)
|
||||||
end
|
end
|
||||||
|
json.products @platform.products do |json_products, product|
|
||||||
|
json.partial! 'api/v1/products/product', :product => product, :json => json_products
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -1,9 +0,0 @@
|
||||||
json.platform do |json_platform|
|
|
||||||
json.partial! 'api/v1/platforms/platform', :platform => @platform, :json => json_platform
|
|
||||||
end
|
|
||||||
|
|
||||||
json.products @products do |json, product|
|
|
||||||
json.partial! 'product', :product => product, :json => json
|
|
||||||
end
|
|
||||||
|
|
||||||
json.url api_v1_products_path(@platform.id, :format => :json)
|
|
|
@ -35,7 +35,6 @@ Rosa::Application.routes.draw do
|
||||||
put :clear
|
put :clear
|
||||||
}
|
}
|
||||||
resources :maintainers, :only => [ :index ]
|
resources :maintainers, :only => [ :index ]
|
||||||
resources :products, :only => :index
|
|
||||||
end
|
end
|
||||||
resources :repositories, :only => [:show, :update, :destroy] do
|
resources :repositories, :only => [:show, :update, :destroy] do
|
||||||
member {
|
member {
|
||||||
|
|
Loading…
Reference in New Issue