Revision 6771b4cd
Added by Martin Bacovsky almost 12 years ago
- ID 6771b4cd619d668d7bb79802de155e15ec0df874
app/controllers/api/v1/architectures_controller.rb | ||
---|---|---|
module Api
|
||
module V1
|
||
class ArchitecturesController < BaseController
|
||
include Foreman::Controller::AutoCompleteSearch
|
||
before_filter :find_by_name, :only => %w{show update destroy}
|
||
|
||
def index
|
||
@architectures = Architecture.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page], :include => :operatingsystems)
|
||
end
|
||
|
||
def show
|
||
end
|
||
|
||
def create
|
||
respond_with Architecture.new(params[:architecture])
|
||
end
|
||
|
||
def update
|
||
respond_with @architecture.update_attributes(params[:architecture])
|
||
end
|
||
|
||
def destroy
|
||
respond_with @architecture.destroy
|
||
end
|
||
end
|
||
end
|
||
end
|
config/routes.rb | ||
---|---|---|
namespace :api, :defaults => {:format => 'json'} do
|
||
scope :module => :v1, :constraints => ApiConstraints.new(:version => 1, :default => true) do
|
||
resources :bookmarks, :except => [:new, :edit]
|
||
resources :architectures, :except => [:new, :edit]
|
||
match '/', :to => 'home#index'
|
||
match 'status', :to => 'home#status', :as => "status"
|
||
end
|
Also available in: Unified diff
added architectures controller in v1 API