Module: DataMapper::ExtJS::Resource
- Defined in:
- lib/dm-extjs/resource.rb
Instance Method Summary collapse
Instance Method Details
#ext_errors ⇒ Object
15 16 17 |
# File 'lib/dm-extjs/resource.rb', line 15 def ext_errors respond_to?(:errors) ? errors.to_a : [] end |
#to_extjs(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/dm-extjs/resource.rb', line 5 def to_extjs (={}) ret = { :metaData => self.class.([:methods]), :success => .has_key?(:success) ? [:success] : (saved? && clean?), :message => (ext_errors << ([:message] || '')).join("\n"), :results => self.to_json(.merge(:to_json => false)) } .fetch(:to_json, true) ? ret.to_json : ret end |