We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ApplicationController.render
I think, ApplicationController.render should return data in json format when it works with jbuilder templates. Right now it returns a string.
json
jbuilder
There is a similar problem and expectation from SO user:
http://stackoverflow.com/questions/39103685/can-you-invoke-jbuilder-to-create-a-native-rails-object-instead-of-a-rendered-st
Right now I solved it with simple helpers, like this:
module ChannelHelper def render_view(params) ApplicationController.render(params) end def render_json(params) JSON.parse render_view(params) end def broadcast channel, message ActionCable.server.broadcast channel, message end end
https://github.com/DeployRB/Rails5App/blob/master/app/channels/notes_channel.rb#L18
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think,
ApplicationController.render
should return data injson
format when it works withjbuilder
templates. Right now it returns a string.There is a similar problem and expectation from SO user:
http://stackoverflow.com/questions/39103685/can-you-invoke-jbuilder-to-create-a-native-rails-object-instead-of-a-rendered-st
Right now I solved it with simple helpers, like this:
https://github.com/DeployRB/Rails5App/blob/master/app/channels/notes_channel.rb#L18
The text was updated successfully, but these errors were encountered: