Skip to content
Newer
Older
100644 511 lines (368 sloc) 16.7 KB
eec7acb @nesquena Initial commit to rabl
authored
1 # RABL #
2
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
3 RABL (Ruby API Builder Language) is a Rails and [Padrino](http://padrinorb.com) ruby templating system for generating JSON, XML, MessagePack and BSON. When using the ActiveRecord 'to_json' method, I tend to quickly find myself wanting a more expressive and powerful solution for generating APIs.
2d54230 @nesquena Minor README cleanups
authored
4 This is especially frustrating when the JSON representation is complex or doesn't match the exact schema defined in the database.
eec7acb @nesquena Initial commit to rabl
authored
5
2d54230 @nesquena Minor README cleanups
authored
6 I wanted a simple and flexible system for generating my APIs. In particular, I wanted to easily:
eec7acb @nesquena Initial commit to rabl
authored
7
a98331f @nesquena Edited README.md via GitHub
authored
8 * Create arbitrary nodes named based on combining data in an object
9 * Pass arguments to methods and store the result as a child node
2d54230 @nesquena Minor README cleanups
authored
10 * Render partial templates and inherit to reduce code duplication
11 * Rename or alias attributes to change the name from the model
12 * Append attributes from a child into a parent node
13 * Include nodes only if a certain condition has been met
eec7acb @nesquena Initial commit to rabl
authored
14
2d54230 @nesquena Minor README cleanups
authored
15 Anyone who has tried the 'to_json' method used in ActiveRecord for generating a JSON response has felt the pain of this restrictive approach.
16 RABL is a general templating system created to solve these problems in an entirely new way.
eec7acb @nesquena Initial commit to rabl
authored
17
18 ## Installation ##
19
e958e9d @nesquena Updates to README
authored
20 Install RABL as a gem:
273c086 @nesquena Adds more notes about installation
authored
21
902ec60 @nesquena More README formatting
authored
22 ```
23 gem install rabl
24 ```
eec7acb @nesquena Initial commit to rabl
authored
25
273c086 @nesquena Adds more notes about installation
authored
26 or add to your Gemfile:
27
902ec60 @nesquena More README formatting
authored
28 ```ruby
29 # Gemfile
30 gem 'rabl'
ada03e1 @nesquena Make a note in readme about using yajl-ruby
authored
31 # Also add either `json` or `yajl-ruby` as the JSON parser
32 gem 'yajl-ruby'
902ec60 @nesquena More README formatting
authored
33 ```
273c086 @nesquena Adds more notes about installation
authored
34
35 and run `bundle install` to install the dependency.
36
1ab2c5b @nesquena Update readme to reflect 3.1 works
authored
37 If you are using **Rails 2.X, Rails 3.X or Padrino**, RABL works without configuration.
d1959f2 @nesquena README for Rails 3 support
authored
38
39 With Sinatra, or any other tilt-based framework, simply register:
d8c8a85 @nesquena Add note about Padrino/Rails/Tilt
authored
40
41 Rabl.register!
42
081a84c @nesquena Adds to the README
authored
43 and RABL will be initialized and ready for use. For usage with Sinatra, check out
44 the [Sinatra Usage](https://github.com/nesquena/rabl/wiki/Setup-for-Sinatra) guide.
d8c8a85 @nesquena Add note about Padrino/Rails/Tilt
authored
45
1ab2c5b @nesquena Update readme to reflect 3.1 works
authored
46 **Note:** Users have reported a few rendering issues with Rails 3.2.
5b027e7 @nesquena Add mention of issues with Rails 3.2
authored
47 The [template handler](https://github.com/nesquena/rabl/blob/master/lib/rabl/template.rb) probably needs
48 a patch to properly support Rails 3.2. Hopefully I can get to it soon but patches are welcome.
49
478a6ab @nesquena Updates README with overview
authored
50 ## Overview ##
51
2d54230 @nesquena Minor README cleanups
authored
52 You can use RABL to generate JSON and XML based APIs from any ruby object.
53 With RABL, the data typically is derived primarily from models (ORM-agnostic) and the representation of the API output is described within
54 a view template using a simple ruby DSL. This allows you to keep your data separated from the JSON or XML you wish to output.
478a6ab @nesquena Updates README with overview
authored
55
2d54230 @nesquena Minor README cleanups
authored
56 Once you have installed RABL (explained above), you can construct a RABL view template and then render the template
57 from your Sinatra, Padrino or Rails applications from the controller (or route) very easily. Using [Padrino](http://padrinorb.com) as an
58 example, assuming you have a `Post` model filled with blog posts, you can render an API representation (both JSON and XML) by creating a route:
478a6ab @nesquena Updates README with overview
authored
59
60 ```ruby
61 # app/app.rb
62 get "/posts", :provides => [:json, :xml] do
63 @user = current_user
64 @posts = Post.order("id DESC")
65 render "posts/index"
66 end
67 ```
68
4480f83 @nesquena Small tweaks to README again
authored
69 Then we can create the following RABL template to express the API output of `@posts`:
478a6ab @nesquena Updates README with overview
authored
70
71 ```ruby
72 # app/views/posts/index.rabl
73 collection @posts
74 attributes :id, :title, :subject
75 child(:user) { attributes :full_name }
76 node(:read) { |post| post.read_by?(@user) }
77 ```
78
79 Which would output the following JSON or XML when visiting `http://localhost:3000/posts.json`
80
81 ```json
82 [{ post :
83 {
84 id : 5, title: "...", subject: "...",
85 user : { full_name : "..." },
86 read : true
87 }
88 }]
89 ```
90
2d54230 @nesquena Minor README cleanups
authored
91 That's a basic overview but there is a lot more to see such as partials, inheritance, custom nodes, etc. Read the full details of RABL below.
478a6ab @nesquena Updates README with overview
authored
92
799084f @nesquena Adds a note about RABL configuration
authored
93 ## Configuration ##
94
fa7be4a @nesquena Minor updates to README
authored
95 RABL is intended to require little to no configuration to get working. This is the case in most scenarios, but depending on your needs you may want to set the following global configurations in your application (this block is completely optional):
799084f @nesquena Adds a note about RABL configuration
authored
96
902ec60 @nesquena More README formatting
authored
97 ```ruby
98 # config/initializers/rabl_init.rb
99 Rabl.configure do |config|
bd0dff9 @nesquena Rabl disables source_cache by default, adds configuration, readme notes
authored
100 # Commented as these are defaults
101 # config.cache_sources = false
3ece462 @nesquena Adds multi_json to Gemfile
authored
102 # config.json_engine = nil # Any multi\_json engines
ae108f5 @byu Adds optional msgpack serialization format to Rabl.
byu authored
103 # config.msgpack_engine = nil # Defaults to ::MessagePack
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
104 # config.bson_engine = nil # Defaults to ::BSON
902ec60 @nesquena More README formatting
authored
105 # config.include_json_root = true
ae108f5 @byu Adds optional msgpack serialization format to Rabl.
byu authored
106 # config.include_msgpack_root = true
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
107 # config.include_bson_root = true
902ec60 @nesquena More README formatting
authored
108 # config.include_xml_root = false
109 # config.enable_json_callbacks = false
bae7071 @nesquena Allow passing of system wide xml options [Thanks mpagalan]
authored
110 # config.xml_options = { :dasherize => true, :skip_types => false }
902ec60 @nesquena More README formatting
authored
111 end
112 ```
799084f @nesquena Adds a note about RABL configuration
authored
113
bd0dff9 @nesquena Rabl disables source_cache by default, adds configuration, readme notes
authored
114 Each option specifies behavior related to RABL's output. If `include_json_root` is disabled that removes the
115 root node for each child in the output, and `enable_json_callbacks` enables support for 'jsonp' style callback
116 output if the incoming request has a 'callback' parameter.
799084f @nesquena Adds a note about RABL configuration
authored
117
bd0dff9 @nesquena Rabl disables source_cache by default, adds configuration, readme notes
authored
118 If `cache_sources` is set to `true`, template lookups will be cached for improved performance.
119 The cache can be reset manually by running `Rabl.reset_source_cache!` within your application.
120
121 Note that the `json_engine` option uses the [multi_json](http://intridea.com/2010/6/14/multi-json-the-swappable-json-handler) intelligent engine
122 defaults so in most cases you **don't need to configure this** directly. If you wish to use yajl as
123 the primary JSON encoding engine simply add that to your Gemfile:
3ece462 @nesquena Adds multi_json to Gemfile
authored
124
125 ```ruby
126 # Gemfile
127 gem 'yajl-ruby', :require => "yajl"
128 ```
129
130 and RABL will automatically start using that engine for encoding your JSON responses!
131
ae108f5 @byu Adds optional msgpack serialization format to Rabl.
byu authored
132 ### Message Pack ###
133
134 Rabl also includes optional support for [Message Pack](http://www.msgpack.org/) serialization format using the [msgpack gem](https://rubygems.org/gems/msgpack).
135 To enable, include the msgpack gem in your project's Gemfile. Then use Rabl as normal with the `msgpack` format (akin to json and xml formats).
136
137 ```ruby
138 # Gemfile
139 gem 'msgpack', '~> 0.4.5'
140 ```
141
142 One can additionally use a custom Message Pack implementation by setting the Rabl `msgpack_engine` configuration attribute. This custom message pack engine must conform to the MessagePack#pack method signature.
143
144 ```ruby
145 class CustomEncodeEngine
146 def self.pack string
147 # Custom Encoding by your own engine.
148 end
149 end
150
151 Rabl.configure do |config|
152 config.msgpack_engine = CustomEncodeEngine
153 end
154 ```
155
933808d @nesquena Minor fixes to the README
authored
156 *NOTE*: Attempting to render the msgpack format without either including the msgpack gem
157 or setting a `msgpack_engine` will cause an exception to be raised.
ae108f5 @byu Adds optional msgpack serialization format to Rabl.
byu authored
158
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
159 ### BSON ###
160
161 Rabl also includes optional support for [BSON](http://bsonspec.org/) serialization format using the [bson gem](https://rubygems.org/gems/bson).
162 To enable, include the bson gem in your project's Gemfile. Then use Rabl as normal with the `bson` format (akin to json and xml formats).
163
164 ```ruby
165 # Gemfile
166 gem 'bson', '~> 1.5.2'
167 ```
011aa46 @nesquena Fix to README
authored
168
169 To use it with Rails, also register the bson mime type format:
170
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
171 ```ruby
172 # config/initializers/mime_types.rb
173 Mime::Type.register "application/bson", :bson
174 ```
175
933808d @nesquena Minor fixes to the README
authored
176 One can additionally use a custom BSON implementation by setting the Rabl `bson_engine` configuration attribute.
177 This custom BSON engine must conform to the BSON#serialize method signature.
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
178
179 ```ruby
180 class CustomEncodeEngine
181 def self.serialize string
182 # Custom Encoding by your own engine.
183 end
184 end
185
186 Rabl.configure do |config|
187 config.bson_engine = CustomEncodeEngine
188 end
189 ```
190
933808d @nesquena Minor fixes to the README
authored
191 *NOTE*: Attempting to render the bson format without either including the bson gem or
192 setting a `bson_engine` will cause an exception to be raised.
b9ec72b @Antiarchitect BSON format support provided. Fixed pluralization (without requiring …
Antiarchitect authored
193
eec7acb @nesquena Initial commit to rabl
authored
194 ## Usage ##
195
f9e74fd @nesquena Adds note about object assignment
authored
196 ### Object Assignment ###
197
a98331f @nesquena Edited README.md via GitHub
authored
198 To declare the data object for use in the template:
f9e74fd @nesquena Adds note about object assignment
authored
199
902ec60 @nesquena More README formatting
authored
200 ```ruby
201 # app/views/users/show.json.rabl
202 object @user
203 ```
f9e74fd @nesquena Adds note about object assignment
authored
204
08f7666 @nesquena Update README and TODO with object aliases
authored
205 or specify an alias for the object:
206
902ec60 @nesquena More README formatting
authored
207 ```ruby
208 object @user => :person
209 # => { "person" : { ... } }
210 ```
08f7666 @nesquena Update README and TODO with object aliases
authored
211
ea780c4 @nesquena Update the readme with the new collection syntax
authored
212 or pass a collection of objects:
f9e74fd @nesquena Adds note about object assignment
authored
213
902ec60 @nesquena More README formatting
authored
214 ```ruby
215 collection @users
216 # => [ { "user" : { ... } } ]
217 ```
f9e74fd @nesquena Adds note about object assignment
authored
218
af5594a @nesquena [engine,builder] collection method now accepts rootname options
authored
219 or specify a root node label for the collection:
ea780c4 @nesquena Update the readme with the new collection syntax
authored
220
902ec60 @nesquena More README formatting
authored
221 ```ruby
222 collection @users => :people
223 # => { "people" : [ { "person" : { ... } } ] }
224 ```
ea780c4 @nesquena Update the readme with the new collection syntax
authored
225
af5594a @nesquena [engine,builder] collection method now accepts rootname options
authored
226 or even specify both the child and root labels for a collection:
227
228 ```ruby
3dad662 @nesquena Fix type in README
authored
229 collection @users, :root => "people", :object_root => "user"
af5594a @nesquena [engine,builder] collection method now accepts rootname options
authored
230 # => { "people" : [ { "user" : { ... } } ] }
231 ```
232
ea780c4 @nesquena Update the readme with the new collection syntax
authored
233 and this will be used as the default data for the rendering.
f9e74fd @nesquena Adds note about object assignment
authored
234
6c5b3c8 @nesquena Updates README to include more examples
authored
235 There can also be odd cases where the root-level of the response doesn't map directly to any object:
236
902ec60 @nesquena More README formatting
authored
237 ```ruby
238 object false
f8b5b26 @nesquena More readme cleanup
authored
239 node(:some_count) { |m| @user.posts.count }
902ec60 @nesquena More README formatting
authored
240 child(@user) { attribute :name }
241 ```
6c5b3c8 @nesquena Updates README to include more examples
authored
242
f8b5b26 @nesquena More readme cleanup
authored
243 In those cases, object can be assigned to 'false' and nodes can be constructed free-form.
6c5b3c8 @nesquena Updates README to include more examples
authored
244
2b1b46f @nesquena Improve readme docs
authored
245 ### Attributes ###
246
a98331f @nesquena Edited README.md via GitHub
authored
247 Basic usage of the templater to define a few simple attributes for the response:
eec7acb @nesquena Initial commit to rabl
authored
248
902ec60 @nesquena More README formatting
authored
249 ```ruby
250 # app/views/users/show.json.rabl
251 attributes :id, :foo, :bar
252 ```
eec7acb @nesquena Initial commit to rabl
authored
253
a98331f @nesquena Edited README.md via GitHub
authored
254 or use with aliased attributes:
3951fb7 @nesquena Updates and prepare for initial release
authored
255
902ec60 @nesquena More README formatting
authored
256 ```ruby
257 # Take the value of model attribute `foo` and name the node `bar`
258 attribute :foo => :bar
259 # => { bar : 5 }
260 ```
0e36cb2 @nesquena Cleans up attribute doc
authored
261
a98331f @nesquena Edited README.md via GitHub
authored
262 or even multiple aliased attributes:
0e36cb2 @nesquena Cleans up attribute doc
authored
263
902ec60 @nesquena More README formatting
authored
264 ```ruby
265 attributes :bar => :baz, :dog => :animal
266 # => # { baz : <bar value>, animal : <dog value> }
267 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
268
2b1b46f @nesquena Improve readme docs
authored
269 ### Child Nodes ###
270
6c5b3c8 @nesquena Updates README to include more examples
authored
271 Often a response requires including nested information from data associated with the parent model:
272
902ec60 @nesquena More README formatting
authored
273 ```ruby
274 child :address do
275 attributes :street, :city, :zip, :state
276 end
277 ```
6c5b3c8 @nesquena Updates README to include more examples
authored
278
279 You can also add child nodes from an arbitrary data source:
3951fb7 @nesquena Updates and prepare for initial release
authored
280
902ec60 @nesquena More README formatting
authored
281 ```ruby
282 child @posts => :foobar do
283 attributes :id, :title
284 end
285 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
286
6c5b3c8 @nesquena Updates README to include more examples
authored
287 or use model associations with an alias:
3951fb7 @nesquena Updates and prepare for initial release
authored
288
902ec60 @nesquena More README formatting
authored
289 ```ruby
290 # Renders all the 'posts' association
291 # from the model into a node called 'foobar'
292 child :posts => :foobar do
293 attributes :id, :title
294 end
295 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
296
a98331f @nesquena Edited README.md via GitHub
authored
297 ### Gluing Attributes ###
2b1b46f @nesquena Improve readme docs
authored
298
a98331f @nesquena Edited README.md via GitHub
authored
299 You can also append child attributes back to the root node:
2b1b46f @nesquena Improve readme docs
authored
300
902ec60 @nesquena More README formatting
authored
301 ```ruby
302 # Appends post_id and post_name to parent json object
303 glue @post do
304 attributes :id => :post_id, :name => :post_name
305 end
306 ```
2b1b46f @nesquena Improve readme docs
authored
307
308 Use glue to add additional attributes to the parent object.
309
310 ### Custom Nodes ###
311
f8b5b26 @nesquena More readme cleanup
authored
312 This will generate a json response based on the result of the `node` block:
2b1b46f @nesquena Improve readme docs
authored
313
902ec60 @nesquena More README formatting
authored
314 ```ruby
315 # app/views/users/show.json.rabl
f8b5b26 @nesquena More readme cleanup
authored
316 node :full_name do |u|
902ec60 @nesquena More README formatting
authored
317 u.first_name + " " + u.last_name
318 end
319 ```
2b1b46f @nesquena Improve readme docs
authored
320
627e51a @nesquena Adds support for 'if' conditional in code
authored
321 or a custom node that exists only if a condition is true:
322
902ec60 @nesquena More README formatting
authored
323 ```ruby
324 # m is the object being rendered, also supports :unless
f8b5b26 @nesquena More readme cleanup
authored
325 node(:foo, :if => lambda { |m| m.has_foo? }) do |m|
902ec60 @nesquena More README formatting
authored
326 m.foo
327 end
328 ```
627e51a @nesquena Adds support for 'if' conditional in code
authored
329
f8b5b26 @nesquena More readme cleanup
authored
330 or don't pass a name and have the node block merged into the response:
340ed76 @nesquena Add code block with optional name to readme and changelog
authored
331
332 ```ruby
f8b5b26 @nesquena More readme cleanup
authored
333 node do |u|
340ed76 @nesquena Add code block with optional name to readme and changelog
authored
334 { :full_name => u.first_name + " " + u.last_name }
335 # => { full_name : "Bob Johnson" }
336 end
337 ```
338
f8b5b26 @nesquena More readme cleanup
authored
339 You can use custom nodes like these to create flexible representations of a value utilizing all the data from the model.
2b1b46f @nesquena Improve readme docs
authored
340
da37d89 @nesquena Adds sub sections for features
authored
341 ### Partials ###
2b1b46f @nesquena Improve readme docs
authored
342
8dc65a4 @nesquena Minor cleanup to partial README
authored
343 Often you need to access other data objects in order to construct custom nodes in more complex associations. You can get access to the rabl representation of another data object by rendering a RABL partial:
3951fb7 @nesquena Updates and prepare for initial release
authored
344
902ec60 @nesquena More README formatting
authored
345 ```ruby
f8b5b26 @nesquena More readme cleanup
authored
346 node :location do
8dc65a4 @nesquena Minor cleanup to partial README
authored
347 { :city => @city, :address => partial("users/address", :object => @address) }
902ec60 @nesquena More README formatting
authored
348 end
349 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
350
8dc65a4 @nesquena Minor cleanup to partial README
authored
351 or event access an object associated with the parent model:
3951fb7 @nesquena Updates and prepare for initial release
authored
352
902ec60 @nesquena More README formatting
authored
353 ```ruby
f8b5b26 @nesquena More readme cleanup
authored
354 node :location do |m|
8dc65a4 @nesquena Minor cleanup to partial README
authored
355 { :city => m.city, :address => partial("users/address", :object => m.address) }
902ec60 @nesquena More README formatting
authored
356 end
357 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
358
8dc65a4 @nesquena Minor cleanup to partial README
authored
359 You can use this method to construct arbitrarily complex nodes for your APIs. Note that you need to have RABL templates defined
360 for each of the objects you wish to construct representations for in this manner.
2b1b46f @nesquena Improve readme docs
authored
361
da37d89 @nesquena Adds sub sections for features
authored
362 ### Inheritance ###
2b1b46f @nesquena Improve readme docs
authored
363
a98331f @nesquena Edited README.md via GitHub
authored
364 Another common issue of many template builders is unnecessary code redundancy. Typically many representations of an object across multiple endpoints share common attributes or nodes. The nodes for a 'post' object are probably the same or similar in most references throughout the various endpoints.
2b1b46f @nesquena Improve readme docs
authored
365
366 RABL has the ability to extend other "base" rabl templates and additional attributes:
3951fb7 @nesquena Updates and prepare for initial release
authored
367
902ec60 @nesquena More README formatting
authored
368 ```ruby
369 # app/views/users/advanced.json.rabl
370 extends "users/base" # another RABL template in "app/views/users/base.json.rabl"
3951fb7 @nesquena Updates and prepare for initial release
authored
371
f8b5b26 @nesquena More readme cleanup
authored
372 node :can_drink do |m|
902ec60 @nesquena More README formatting
authored
373 m.age > 21
374 end
375 ```
3951fb7 @nesquena Updates and prepare for initial release
authored
376
a98331f @nesquena Edited README.md via GitHub
authored
377 You can also extend other rabl templates while constructing child nodes to reduce duplication:
61d9f8d @nesquena Cleanup readme order
authored
378
902ec60 @nesquena More README formatting
authored
379 ```ruby
380 # app/views/users/show.json.rabl
381 child @address do
382 extends "address/item"
383 end
384 ```
61d9f8d @nesquena Cleanup readme order
authored
385
2b1b46f @nesquena Improve readme docs
authored
386 Using partials and inheritance can significantly reduce code duplication in your templates.
61d9f8d @nesquena Cleanup readme order
authored
387
081a84c @nesquena Adds to the README
authored
388 ## Template Scope ##
389
390 In RABL, you have access to everything you need to build an API response. Each RABL template has full access to the controllers
391 instance variables as well as all view helpers and routing urls.
392
393 ```ruby
394 # app/some/template.rabl
395 object @post
396 # Access instance variables
397 child(@user => :user) { ... }
398 # or Rails helpers
f8b5b26 @nesquena More readme cleanup
authored
399 node(:formatted_body) { |post| simple_format(post.body) }
081a84c @nesquena Adds to the README
authored
400 ```
401
402 There should be no problem fetching the appropriate data to construct a response.
403
d86f423 @nesquena Adds 'deep nesting' example to the README
authored
404 ### Deep Nesting ###
405
406 In APIs, you can often need to construct 2nd or 3rd level nodes. Let's suppose we have a 'quiz' model that has many 'questions'
407 and then each question has many 'answers'. We can display this hierarchy in RABL quite easily:
408
afd747a @nesquena Update README formatting on certain blocks
authored
409 ```ruby
410 # app/views/quizzes/show.json.rabl
411 object @quiz
412 attribute :title
413 child :questions do
414 attribute :caption
415 child :answers do
416 # Use inheritance to reduce duplication
417 extends "answers/item"
418 end
419 end
420 ```
d86f423 @nesquena Adds 'deep nesting' example to the README
authored
421
422 This will display the quiz object with nested questions and answers as you would expect with a quiz node, and embedded questions and answers.
423 Note that RABL can be nested arbitrarily deep within child nodes to allow for these representations to be defined.
424
081a84c @nesquena Adds to the README
authored
425 ### Advanced Usage ###
63b9c6f @nesquena Adds scope section to README
authored
426
623e7f0 @nesquena Update changelog and readme
authored
427 Links to resources for advanced usage:
428
081a84c @nesquena Adds to the README
authored
429 * Rendering JSON for a tree structure using RABL: https://github.com/nesquena/rabl/issues/70
99ba45d Updated README with layouts information
Andrey Ognevsky authored
430 * Layouts (erb, haml and rabl) in RABL: https://github.com/nesquena/rabl/wiki/Using-Layouts
f71df26 @nesquena Adds link to backbone integration to readme
authored
431 * Backbone or [Ember.js](http://www.emberjs.com) Integration: https://github.com/nesquena/rabl/wiki/Backbone-Integration
63b9c6f @nesquena Adds scope section to README
authored
432
c5e4f1c @nesquena Adds a link to the wiki to readme
authored
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.
623e7f0 @nesquena Update changelog and readme
authored
435
436 ### Tutorials ###
437
c89920a @nesquena More README tweaks
authored
438 Tutorials can always be helpful when first getting started:
623e7f0 @nesquena Update changelog and readme
authored
439
be90bfc @nesquena Adds Railscast as a tutorial to readme
authored
440 * [Railscasts #322](http://railscasts.com/episodes/322-rabl)
623e7f0 @nesquena Update changelog and readme
authored
441 * http://blog.joshsoftware.com/2011/12/23/designing-rails-api-using-rabl-and-devise/
442 * http://engineering.gomiso.com/2011/06/27/building-a-platform-api-on-rails/
788429f @nesquena More tutorials for the README
authored
443 * http://blog.lawrencenorton.com/better-json-requests-with-rabl
444 * http://www.rodrigoalvesvieira.com/developing-json-api-rails-rabl/
445 * http://tech.favoritemedium.com/2011/06/using-rabl-in-rails-json-web-api.html
446 * http://seesparkbox.com/foundry/better_rails_apis_with_rabl
d58a31e @nesquena Adds more tutorials to readme
authored
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
623e7f0 @nesquena Update changelog and readme
authored
449
450 Let me know if there's any other useful resources.
451
8bb9336 @nesquena Updates readme with troubleshooting
authored
452 ### Troubleshooting ###
453
454 * Redundant calls for a collection: https://github.com/nesquena/rabl/issues/142#issuecomment-2969107
455
3951fb7 @nesquena Updates and prepare for initial release
authored
456 ## Issues ##
eec7acb @nesquena Initial commit to rabl
authored
457
2dd0fdd @nesquena Updates issues in the README
authored
458 Check out the [Issues](https://github.com/nesquena/rabl/issues) tab for a full list:
459
460 * Better Tilt template support (precompiling templates)
461 * Benchmarks and performance optimizations
9e691d3 @nesquena Edited README.md via GitHub
authored
462
7279490 @nesquena Add travis CI badge to readme
authored
463 ## Continuous Integration
464
465 [![Continuous Integration status](https://secure.travis-ci.org/nesquena/rabl.png)](http://travis-ci.org/nesquena/rabl)
466
467 CI is hosted by [travis-ci.org](http://travis-ci.org).
468
9e691d3 @nesquena Edited README.md via GitHub
authored
469 ## Authors and Contributors ##
470
f3454c1 @nesquena Added Tim and Miso to README
authored
471 Thanks to [Miso](http://gomiso.com) for allowing me to create this for our applications and release this project!
472
9e691d3 @nesquena Edited README.md via GitHub
authored
473 * [Nathan Esquenazi](https://github.com/nesquena) - Creator of the project
474 * [Arthur Chiu](https://github.com/achiu) - Core Maintainer, Riot Testing Guru
f3454c1 @nesquena Added Tim and Miso to README
authored
475 * [Tim Lee](https://github.com/timothy1ee) - RABL is an awesome name and was chosen by the Miso CTO.
245b236 @nesquena Adds changelog to repo
authored
476 * [Rick Thomas](https://github.com/rickthomasjr) - Added options for extends and Sinatra testing
0d6caef @nesquena Adds to changelog and adds @Antiarchitect to readme
authored
477 * [Benjamin Yu](https://github.com/byu) - Added msgpack format support
1e8b95d @nesquena Adds kimptoc to README
authored
478 * [Chris Kimpton](https://github.com/kimptoc) - Helping with documentation and wiki
245b236 @nesquena Adds changelog to repo
authored
479 * [Marjun](https://github.com/mpagalan) - Added xml option configurations
480 * [Anton Orel](https://github.com/skyeagle) - Added Rails 3.1 compatibility
3ece462 @nesquena Adds multi_json to Gemfile
authored
481 * [Sasha Koss](https://github.com/kossnocorp) - Added multi_json support
153f695 @nesquena Merge in configuration cleanup and add mschulkind to readme
authored
482 * [Matthew Schulkind](https://github.com/mschulkind) - Cleanup of configuration and tests
bca6f35 @nesquena Add attributions in CHANGELOG and to README
authored
483 * [Luke van der Hoeven](https://github.com/plukevdh) - Support non-ORM objects in templates
0d6caef @nesquena Adds to changelog and adds @Antiarchitect to readme
authored
484 * [Andrey Voronkov](https://github.com/Antiarchitect) - Added BSON format support
a890ce1 @nesquena Added Rick Thomas to readme
authored
485
bca6f35 @nesquena Add attributions in CHANGELOG and to README
authored
486 and many more contributors listed in the [CHANGELOG](https://github.com/nesquena/rabl/blob/master/CHANGELOG.md).
65b32ff @nesquena Add link to request for msgpack support
authored
487
0d6caef @nesquena Adds to changelog and adds @Antiarchitect to readme
authored
488 Want to contribute support for another format?
489 Check out the patch for [msgpack support](https://github.com/nesquena/rabl/pull/69) and
490 [BSON support](https://github.com/nesquena/rabl/pull/163).
ecfe9d9 @nesquena Update README again
authored
491
bca6f35 @nesquena Add attributions in CHANGELOG and to README
authored
492 Please fork and contribute, any help in making this project better is appreciated!
2dd0fdd @nesquena Updates issues in the README
authored
493
9e691d3 @nesquena Edited README.md via GitHub
authored
494 ## Inspirations ##
495
496 There are a few excellent libraries that helped inspire RABL and they are listed below:
497
498 * [Tequila](https://github.com/inem/tequila)
499 * [JSON Builder](https://github.com/dewski/json_builder)
500 * [Argonaut](https://github.com/jbr/argonaut)
501
2f7d908 @nesquena Adds examples and copyright to readme
authored
502 Thanks again for all of these great projects.
503
504 ## Examples
505
506 See the [examples](https://github.com/nesquena/rabl/tree/master/examples) directory.
507
508 ## Copyright
509
ecfe9d9 @nesquena Update README again
authored
510 Copyright © 2011-2012 Nathan Esquenazi. See [MIT-LICENSE](https://github.com/nesquena/rabl/blob/master/MIT-LICENSE) for details.
Something went wrong with that request. Please try again.