Skip to content
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

How can I send data in hash with other keys? #29

Open
an-nasir opened this issue Oct 12, 2018 · 1 comment
Open

How can I send data in hash with other keys? #29

an-nasir opened this issue Oct 12, 2018 · 1 comment

Comments

@an-nasir
Copy link

My code looks like this, I need to render other keys
unless params[:search].present?
@response.merge!({code: 0, message:"failed, please provide search term"})
else
data = Model.search(params[:search])
@response[:data] = { search_result: data, size: data.count }
@response.merge!({code: 1, message:"success"})
end

`render status: :ok, json: @response`

But as pager api it internally renders the given records.

@kurenn
Copy link
Member

kurenn commented Nov 1, 2018

What are you using to render?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants