Open jiggneshhgohel opened 7 years ago
@ccocchi can you please spare some time and provide your guidance on my problem above?
+1 on this issue, would appreciate a ping @ccocchi
This module has been removed because it was trying to replicate too much ActionView internals for little gain and was poorly maintanable.
If you need the old behavior, you could try to copy https://github.com/ccocchi/rabl-rails/blob/v0.4.3/lib/rabl-rails/renderer.rb inside your application and either have RablRails
extend it or call directly RablRails::Renderer.render
as before.
Thank for the update! what is new alternative to this @ccocchi :) also much appreciate the hard work
We've been using the following instead of RablRails::Renderer.render
:
ApplicationController.render(
template: 'api/v1/users/stats',
assigns: { user: @user }
)
Using the suggestions in https://github.com/ccocchi/rabl-rails/issues/88#issuecomment-324875768 I was able to resolve my problem I described in https://github.com/ccocchi/rabl-rails/issues/88#issue-247669661 but I needed few customizations to be made which I have detailed in https://gist.github.com/jiggneshhgohel/1f0137e5dc294cc94141785eaf836c87.
Thanks
Hello,
In our Rail-based API-only app we are generating JSONs by rendering object directly.
Recently we have started upgrading our Rails to
5.1.2
and as part ofbundle update
rabl-rails
gem got updated to v0.5.0
from0.4.3
(bundle update
output snippet)Now we are running our rspec and encountering following error:
I compared the source-code and found that in v
0.4.3
RablRails::Renderer
module exists, however in0.5.0
tree it is removedFound this commit https://github.com/ccocchi/rabl-rails/commit/12a3f0f72dca4ba2112398b26b80912462ab40c6 in which
RablRails::Renderer
module was removed.Since that is removed what is the alternate approach to render the object directly? We are using this same approach of rendering the object directly across our API-only application. So it is very critical that we need this behaviour to be available.
Note: _Ours API application is built on Rails but not using rails built-in api-only features._
Please suggest the possible fixes for this removed behaviour.