rabl 0.5.5.f → 0.5.5.g
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +2 -1
- data/README.md +5 -2
- data/lib/rabl/partials.rb +2 -1
- data/lib/rabl/version.rb +1 -1
- metadata +3 -3
data/.travis.yml
CHANGED
data/README.md
CHANGED
|
@@ -226,7 +226,7 @@ collection @users => :people
|
|
|
226
226
|
or even specify both the child and root labels for a collection:
|
|
227
227
|
|
|
228
228
|
```ruby
|
|
229
|
-
collection @users, :
|
|
229
|
+
collection @users, :root => "people", :object_root => "user"
|
|
230
230
|
# => { "people" : [ { "user" : { ... } } ] }
|
|
231
231
|
```
|
|
232
232
|
|
|
@@ -430,7 +430,8 @@ Links to resources for advanced usage:
|
|
|
430
430
|
* Layouts (erb, haml and rabl) in RABL: https://github.com/nesquena/rabl/wiki/Using-Layouts
|
|
431
431
|
* Backbone or [Ember.js](http://www.emberjs.com) Integration: https://github.com/nesquena/rabl/wiki/Backbone-Integration
|
|
432
432
|
|
|
433
|
-
Please add your own usages and let me know so we can add them here!
|
|
433
|
+
Please add your own usages and let me know so we can add them here! Also be sure to check out
|
|
434
|
+
the [RABL Wiki](https://github.com/nesquena/rabl/wiki) for other usages.
|
|
434
435
|
|
|
435
436
|
### Tutorials ###
|
|
436
437
|
|
|
@@ -443,6 +444,8 @@ Tutorials can always be helpful when first getting started:
|
|
|
443
444
|
* http://www.rodrigoalvesvieira.com/developing-json-api-rails-rabl/
|
|
444
445
|
* http://tech.favoritemedium.com/2011/06/using-rabl-in-rails-json-web-api.html
|
|
445
446
|
* http://seesparkbox.com/foundry/better_rails_apis_with_rabl
|
|
447
|
+
* http://blog.dcxn.com/2011/06/22/rails-json-templates-through-rabl
|
|
448
|
+
* http://teohm.github.com/blog/2011/05/31/using-rabl-in-rails-json-web-api
|
|
446
449
|
|
|
447
450
|
Let me know if there's any other useful resources.
|
|
448
451
|
|
data/lib/rabl/partials.rb
CHANGED
|
@@ -7,8 +7,9 @@ module Rabl
|
|
|
7
7
|
# options must have :object
|
|
8
8
|
# options can have :view_path, :child_root, :root
|
|
9
9
|
def partial(file, options={}, &block)
|
|
10
|
-
raise ArgumentError, "Must provide an :object option to render a partial" unless options
|
|
10
|
+
raise ArgumentError, "Must provide an :object option to render a partial" unless options.has_key?(:object)
|
|
11
11
|
object, view_path = options.delete(:object), options.delete(:view_path)
|
|
12
|
+
return if object.blank?
|
|
12
13
|
source, location = self.fetch_source(file, :view_path => view_path)
|
|
13
14
|
engine_options = options.merge(:source => source, :source_location => location)
|
|
14
15
|
self.object_to_hash(object, engine_options, &block)
|
data/lib/rabl/version.rb
CHANGED
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: rabl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: 6
|
|
5
|
-
version: 0.5.5.
|
|
5
|
+
version: 0.5.5.g
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Nathan Esquenazi
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2012-02-
|
|
13
|
+
date: 2012-02-15 00:00:00 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: multi_json
|
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
300
300
|
requirements: []
|
|
301
301
|
|
|
302
302
|
rubyforge_project: rabl
|
|
303
|
-
rubygems_version: 1.8.
|
|
303
|
+
rubygems_version: 1.8.12
|
|
304
304
|
signing_key:
|
|
305
305
|
specification_version: 3
|
|
306
306
|
summary: General ruby templating with json, bson, xml and msgpack support
|