I am working on a rails API with Representers, using the following gems: Grape, Roar and Grape-Roar
Now, I try to add conditions to include (or not include) certain properties in my representer based on a condition I pass from my API endpoint as…
I am using ROAR to implement an API for a rails application. This application deals with tickets that can have attributes like a subject and a description, but also have user defined attributes. For simplicity lets assume a ticket looks like:
class…
I've read through https://github.com/apotonick/roar and it seems like a lot of thought has been put into ROAR. But in the context of a fairly standard Rails-powered JSON API that uses jbuilder, I'm still not able to immediately see what benefits…
I am upgrading my Rails app from 4.1.1 to 5.1.4.
I am using roar-rails gem to parsing and rendering REST documents. I am facing some issues as responders gem has been extracted to separate gem.
respond_with has been moved to 'responders' gem.
My…
For example, I have a representer looking like:
module AccountRepresenter
include Roar::Representer::JSON
include Roar::Representer::Feature::Hypermedia
property :id
property :name
collection :assets, :extend => AssetRepresenter, :class…
I'm in the process of setting up a centralised data management system + CAS for a series of apps that currently have duplicated data across many databases that is a nightmare to manage.
I've got the CAS system implemented nicely with rubycas-server…
I've looked at this question but it's quite old and I feel there's now other alternatives to ARes.
Given that many people seem to think that ActiveResource is kind of outdated and heavyweight, I've looked at Api Smith, Her, Roar and of course ARes.…
I am trying to render a plain XML output within a Roar::Decorator. For some reason it is not possible to get unescaped output.
I have this class:
class GetShopProductsRequest < OpenStruct
def data_filter
xml_s = []
xml_s << ""
…
This is actually a best practices / usage question on hwo to use Roar & representable in Rails, as I didn't find any examples of that. Here are two scenarios. I use decorator pattern.
Scenario 1:
Let's say I have a Product class that has multiple…
I'm building an app in Ruby/Sinatra where I want to use Roar for JSON (and Hal) output. At the moment I'm having problems with Roar.
These gems are installed:
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.2
Using thread_safe 0.3.4
Using…
I'm currently implementing a JSON based Grape API. I've integrated roar for JSON serailization and deserialization. When executing the following code, it seems that the JSON is encoded twice resulting a response with slashes. Is there anyway on…
I am trying to create new objects with a collection of nested resources. When I POST my json, I get:
ActiveRecord::AssociationTypeMismatch: FormLabel(#70306552439440) expected, got Hash(#70306480154920)
Here's my code:
# form.rb
class Form <…