-
Notifications
You must be signed in to change notification settings - Fork 69
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
Using respond_with method ignores meta data #42
Comments
Hi, sorry but I can not confirm this. We have specs that cover both kinds of controllers and I also tried to reproduce it manually, but everything seems to work fine. This is the controller I tested: class RespondWithUsersController < ApplicationController
respond_to :json, :xml
self.responder = ActsAsApi::Responder
def index
@users = User.where("").all
meta_hash = { :page => 1, :total => 999 }
respond_with @users, :api_template => :name_only, :root => :users, :meta => meta_hash
end
end It produces: {
"page": 1,
"total": 999,
"users": [
{
"first_name": "Me"
},
{
"first_name": "Me2"
}
]
} Can you provide a more specific example or even a rspec test, so I can reproduce the problem? Best, Chris :) |
Is there anything left to say regarding this issue? |
Hello, I have exactly the same issue. Here is the code : class Api::V1::ProjectsController < ApiController Cheers |
When using the
respond_with
rendering method, any data added with the:meta
key is ignored:Where the default
respond_to
block works as expected:The text was updated successfully, but these errors were encountered: