ccocchi / rabl-rails

Rails 4.2+ templating system with JSON, XML and Plist support.
MIT License
209 stars 51 forks source link

Remove format requirement in template filename when using RablRails.render #50

Closed vjt closed 10 years ago

vjt commented 10 years ago

As Rabl can render multiple templates, forcing the user to specify the template format in the file name is a limitation.

This commit removes it, while remaining backwards compatible with the legacy format and printing out a deprecation warning.

Eventually, an XML render test was added.

Thanks for considering a merge! :beers:

cc:@lleirborras

vjt commented 10 years ago

I have another change to submit, so I'm closing this pull now and re-opening another one with a proper topic branch. Sorry for the noise.

lleirborras commented 10 years ago

A good improvement!

On Mon, Jan 27, 2014 at 5:18 PM, Marcello Barnaba notifications@github.comwrote:

As Rabl can render multiple templates, forcing the user to specify the template format in the file name is a limitation.

This commitremoves it, while remaining backwards compatible with the legacy format and printing out a deprecation warning.

Eventually, an XML render test was added.

Thanks for considering a merge! [image: :beers:]

cc:@lleirborras https://github.com/lleirborras

You can merge this Pull Request by running

git pull https://github.com/ifad/rabl-rails master

Or view, comment on, or merge it at:

https://github.com/ccocchi/rabl-rails/pull/50 Commit Summary

  • Remove format requirement when using RablRails.render

File Changes

  • M lib/rabl-rails/renderer.rbhttps://github.com/ccocchi/rabl-rails/pull/50/files#diff-0(29)
  • M test/render_test.rbhttps://github.com/ccocchi/rabl-rails/pull/50/files#diff-1(34)

Patch Links:

— Reply to this email directly or view it on GitHubhttps://github.com/ccocchi/rabl-rails/pull/50 .

Lleïr Borràs i Metje http://about.me/lleir http://about.me/lleir