diff options
Diffstat (limited to 'app/controllers/api')
| -rw-r--r-- | app/controllers/api/v1/networks_controller.rb | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/app/controllers/api/v1/networks_controller.rb b/app/controllers/api/v1/networks_controller.rb index c3d52348b..7443445df 100644 --- a/app/controllers/api/v1/networks_controller.rb +++ b/app/controllers/api/v1/networks_controller.rb @@ -1,25 +1,15 @@ module Api module V1 - class NetworksController < ChouetteController - def networks + class NetworksController < ChouetteController + inherit_resources + + defaults :resource_class => Chouette::Network, :finder => :find_by_objectid! + + protected + + def collection @networks ||= referential.networks end - def network - @network ||= networks.where( :objectid => params[:id]) - end - - def index - respond_to do |format| - format.json { render :json => networks } - format.xml { render :xml => networks } - end - end - def show - respond_to do |format| - format.json { render :json => network } - format.xml { render :xml => network } - end - end end end end |
