Comments (2)
Seems problematic, you should build a test case here for this to begin with.
from grape-active_model_serializers.
@khacluan this is many months late, but you can use ASM's meta
functionality to achieve your use-case. Try this:
class Registrations < Grape::API
resource :users do
get "/", meta_key: message, meta: 'Hello' do
user
end
end
end
something like this would also work if you need to programmatically define the message
class Registrations < Grape::API
resource :users do
get "/" do
render user, meta_key: message, meta: 'Hello'
end
end
end
I'm going to close this issue, as it is almost a year old. If the above doesn't work, please open a new issue.
from grape-active_model_serializers.
Related Issues (20)
- API Versioning: Supporting Active Model Serializers namespacing HOT 4
- Changing adapter in AMS is not affected to output HOT 9
- Issues versioning serializers with Grape 1.4 master HOT 17
- Swagger documentation HOT 3
- Globally specify serialization adapter HOT 1
- Release v. next HOT 5
- Convert all AM keys from snake_case to camelCase HOT 3
- `include: '**'` option not working on serailizers HOT 8
- undefined method `deconstantize' for nil:NilClass HOT 11
- [grape 1.0.0] Json root does not exist in response.
- Custom formatted error messages HOT 1
- default_serializer_options no longer works HOT 1
- Array root documentation HOT 3
- Namespaces with associations HOT 2
- Documentation on the ErrorSerializer HOT 3
- Release v. Next
- How can I have a resource loaded in included (jsonapi format) ?
- Test failures about Hash#deep_dup missing HOT 2
- Custom Metadata not woking
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grape-active_model_serializers.