ruby-grape 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

1

I'm using Grape to build an API. I created an ActiveSupport::Concern let's say with the name Authentication and I applied some before filter so my concern looks like: module Authentication ext...
Bul asked 29/9, 2015 at 15:45

3

Solved

I have difficulties to understand and also properly implement User Authentication in APIs. In other words, I have serious problem to understand the integration of Grape API with front-end framework...
Nutter asked 29/10, 2014 at 6:28

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

In a grape-entity, I want to show a field only if present (not nil?) with no luck. I'm trying this code but doesn't work as expected at all, but hiding the field always. expose :winner, :using =&...
Crampon asked 22/2, 2014 at 6:22

1

Solved

I use gem, grape for api. I tried to get api urls by the command rake grape:routes namespace :grape do desc "routes" task :routes => :environment do API::Root.routes.map { |route| puts "#{r...
Decrement asked 20/6, 2017 at 15:12

1

I am using Grape on top of Rails 4.2.1 to provide API for our application. But when I check Newrelic for performance today I found that RackApp Proc#call and Grape API::Root#call are taking up la...
Oceanography asked 8/5, 2015 at 16:44

0

Let's say i have Base class "Attachment < ActiveRecord::Base" and 2 child classes "Attachment::Video < Attachment" , "Attachment::Image < Attachment". present Attachment.all, with: API::...
Thirsty asked 10/10, 2016 at 9:36

1

Solved

I'm using Rails with Grape as API. I was just curious why there isn't session[:something] method in grape? I can create cookies but can't created signed cookies either. It throw me an error.
Earleanearleen asked 11/2, 2016 at 16:1

0

Using the grape-swagger gem, I've setted a subdomain on Grape Swagger as such in routes.rb constraints subdomain: /api/ do mount Api::V1::Base => '/' end And here is document.rb require 'gr...
Samarskite asked 5/11, 2015 at 16:53

2

Solved

I'm building a web API with Ruby, Grape and ActiveRecord. Coming from ASP.NET Web API I'm used to having automatic model binding from JSON to a class object which then can be saved with Entity Fram...
Shalom asked 30/4, 2015 at 13:24

2

Solved

I'm writing an API server with grape and i choose to use grape-entity because it has the capability to auto generate the documentation for swagger. But now i have a problem when i set a param as re...
Montez asked 8/4, 2015 at 14:20

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

Solved

First: I'm using grape for building my API (Rails 4). When someone is sending an invalid JSON body (e.g. forgot the last }), the following error is raised: ActionDispatch::ParamsParser::ParseErro...
Callean asked 2/3, 2015 at 14:7

1

Solved

I am using Grape and Rails to create a REST API. I have the basic architecture in place and I am looking for places to 'clean' things up. One of those places is the error handling/processing. I am...
Preferential asked 23/10, 2014 at 12:59

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

1

I am working on an app that includes an API that is using the grape gem. Here is my Root Class: module API class Root < Grape::API rescue_from :all do |e| Rack::Response.new( [ "Error: #{e...
Ringdove asked 18/7, 2014 at 20:17

1

Solved

I want to do an API for an Android app. When searching, I found {grape}. I'm following this tutorial, but I have a problem launching the Rails server: => Booting WEBrick => Rails 4.0.2 appli...
Salsbury asked 20/6, 2014 at 3:55

5

Solved

I have a small prototype subclass of Grape::API as a rack service, and am using Grape::Entity to present my application's internal objects. I like the Grape::Entity DSL, but am having trouble find...
Zn asked 19/3, 2013 at 11:22

1

I am using RestSharp for developing on the client side. I am also using Ruby Grape gem for my custom API on server side. Grape gem can do versioning by setting Accept HTTP header f.e to application...
Individuate asked 18/5, 2013 at 23:16
1

© 2022 - 2024 — McMap. All rights reserved.