Class: ResourceFull::Controllers::ResourcesController
- Inherits:
-
Base
- Object
- ActionController::Base
- Base
- ResourceFull::Controllers::ResourcesController
show all
- Defined in:
- lib/resource_full/controllers/resources.rb,
lib/resource_full/controllers/resources_controller.rb
Instance Method Summary
collapse
Methods inherited from Base
all_resources, controller_for, #model_class, #model_name
Instance Method Details
#index_xml ⇒ Object
6
7
8
|
# File 'lib/resource_full/controllers/resources_controller.rb', line 6
def index_xml
render :xml => find_all_resources.to_xml(:root => "resources")
end
|
#show_xml ⇒ Object
10
11
12
13
14
|
# File 'lib/resource_full/controllers/resources_controller.rb', line 10
def show_xml
render :xml => find_resource.to_xml
rescue ResourceFull::ResourceNotFound => e
render :xml => e.to_xml, :status => :not_found
end
|