-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading to 0.5.0 from 0.4.3 encountering error "undefined method `render' for RablRails:Module" #88
Comments
@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 |
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 ApplicationController.render(
template: 'api/v1/users/stats',
assigns: { user: @user }
) |
Using the suggestions in #88 (comment) I was able to resolve my problem I described in #88 (comment) 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 12a3f0f 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.
The text was updated successfully, but these errors were encountered: