Permalink
Browse files

TradingAccount is a SData resource now

  • Loading branch information...
1 parent 9ad220b commit ab1fc7522fbf28924bedc5e61073960ed7a81ab1 Daniel committed Apr 1, 2010
@@ -1,2 +1,7 @@
class TradingAccountsController < ApplicationController
+ acts_as_sdata :model => TradingAccount,
+ :feed => { :id => 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6',
+ :author => 'Sage',
+ :path => '/trading_accounts',
+ :title => 'Trading accounts' }
end
@@ -1,2 +1,3 @@
class TradingAccount < ActiveRecord::Base
-end
+ acts_as_sdata :instance_id => :name
+end
@@ -3,3 +3,7 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
+
+ActionController::Base.param_parsers[Mime::Type.lookup('application/atom+xml')] = Proc.new do |data|
+ { :entry => Atom::Entry.load_entry(data) }
+end
@@ -38,6 +38,8 @@
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing or commenting them out if you're using named routes and resources.
+ map.sdata_resource :trading_accounts
+
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end

0 comments on commit ab1fc75

Please sign in to comment.