grape-api Questions
2
Solved
I have a working rails application with grape-gem working as an end point for some APIs in the application.
I need to get the remote ip for the requester and return it back in the response.
I coul...
Marou asked 6/12, 2013 at 3:7
4
Solved
Here is my code:
class Order < Grape::Entity
expose :id { |order, options| order.id.obfuscate }
expose :time_left_to_review do |order, options|
byebug
order&.time_left_to_review # ERROR...
Mailbag asked 22/8, 2017 at 19:18
4
I want to return raw data/blob from my grape/rest api.
I followed the thread at : https://github.com/intridea/grape/issues/412
for a code like :
get 'foo' do
content_type 'text/plain'
"hello w...
Contagious asked 7/5, 2015 at 1:52
3
Solved
I'm mounting Grape in my Rails project to build a RESTful API.
Now some end-points have actions need authentication and others which don't need authentication.
As for example I have users end-p...
Platform asked 17/10, 2016 at 14:8
2
Solved
I'm using Ember as my front-end and Grape API to serve my API.
The front-end send something like:
{
"service"=>{
"name"=>"Name",
"duration"=>"30",
"user"=>nil,
"organization"=&...
1
Deploying Portus in GCP with an Nginx Ingress load balancer implemented. Portus loads up just fine but when trying to use the application and fill out some of the forms I get the following error:
...
Beltane asked 28/12, 2017 at 5:17
1
Solved
I want to have multiple classes inside grape entity file, this is the folder structure app/api/proj/api/v2/entities/committees.rb
module PROJ::API::V2::Entities
class Committee < Grape::Entity
...
Laryssa asked 15/4, 2017 at 13:9
2
I'm using active_model_serializer 0.10.0.rc5 and grape gem for the api.
I've a post endpoint like this :
class V1::Endpoints::Posts < Grape::API
resource :posts do
desc 'Returns a list of p...
Renata asked 5/5, 2016 at 15:2
1
When writing an API with Grape, why bother using the helpers macro, versus just including a module, or adding a method?
For example, you can define methods in a module and include them as helpers...
6
I'm trying to generate a list of all routes generated by my subclass of Grape::API (MyApi).
I can get close by calling:
MyApi.send(:route_set).instance_variable_get(:@routes)
which gives me an ...
Vd asked 11/6, 2011 at 19:34
1
I'm building an API with Grape on Rails 4.2. Here's a link to the repo on GitHub.
On the frontend, I have a JavaScript application built with EmberJS. Here's the link to the repo on GitHub as well...
Deformed asked 7/7, 2015 at 20:35
1
Solved
I am having a lot of trouble understanding Grape API, specifically route_param and how it works with just params.
Consider this code:
desc "Return a status."
params do
requires :id, type: Intege...
3
I'm attempting to create a restful, json api in ruby - so I'm using grape (https://github.com/intridea/grape) inside of Rack.
I'm not using Rails for this project, so cancan, sorcery, etc... don't ...
Martimartial asked 19/2, 2013 at 19:56
1
Solved
I need to create a POST where I can upload multiple files in the same request, but I don't know how to write this with grape. Right now to upload just one file this is what I'm doing and It's worki...
Gisela asked 30/3, 2015 at 14:52
1
Objective: Use grape Shared Params from a helper module, without having to add the syntax helpers Helper::Module on every mounted API.
Example code that works:
# /app/api/v1/helpers.rb
module V1
...
Mecham asked 10/11, 2014 at 22:57
2
Solved
How does one customise the status code response when using the Grape gem? e.g.
post do
status = :accepted
@order = Order.find(params[:id])
end
This can be achieved for with error!({ error: 'Or...
Emboly asked 26/7, 2014 at 6:27
2
Solved
In every examples I see, people only implement one giant api.rb file. Ex:
intridea/grape
bloudraak/grape-sample-blog-api
djones/grape-goliath-example
While this approach works fine as is, it ca...
Chatman asked 13/2, 2013 at 16:18
5
I am using Swagger-UI to browse my own API, built with grape and automatically documented with grape-swagger.
I've googled and tried every suggestion I can find, but I cannot get POST to work. Her...
Tangy asked 21/12, 2012 at 12:15
1
Solved
I've been reading around and I found this micro-framework called Grape for ruby. I am currently using Sinatra to handle the web interface but I would also like to implement Grape to handle the API ...
1
Consider an HTTP request that gets the following response:
405 Method Not Allowed
Content-Length: 0
What should the content-type of something like this be?
Set to nothing?
Not set?
Set to text...
Prolocutor asked 22/2, 2013 at 20:48
2
Solved
I'm building a XML API with the help of the Grape gem. What is the best way to building XML for API actions? Since Grape isn't using standart rails controllers, i can't use views/../xml.builder. Wh...
Calais asked 21/8, 2012 at 10:17
1
© 2022 - 2024 — McMap. All rights reserved.