Basic usage of Jbuilder in a controller - Stack Overflow
https://stackoverflow.com/questions/54088462/basic-usage-of-jbuilder-in-a-controller
WEBJan 9, 2019 · In a Rails (5.2) app, I'm trying to use JBuilder to return some JSON as response. I have added JBuilder in my Gemfile. # Gemfile ... gem 'jbuilder', '~> 2.5' ... # Gemfile.lock ... jbuilder (2.8.0) ... According to JBuilder documentation: You can also extract attributes from array directly. @people = People.all. json.array! @people, :id, :name
DA: 2 PA: 75 MOZ Rank: 30