rabl Questions
7
Solved
I'd like a Rails controller (all of them, actually, it's an API) to render JSON always always.
I don't want Rails to return "route not found", or try and fail to find an HTML template, or return 4...
Chesna asked 30/5, 2014 at 3:37
1
Solved
I'm having a perplexing problem where my controller is working fine. However, when I'm testing it with RSPEC it's returning an empty string as the response body.
Here is the controller:
class Api...
Ashanti asked 1/7, 2014 at 19:37
3
Solved
I want json output order by id(child id)
Can I solve this problem ?
this is some code in my project
show.json.rabl (I used Rabl)
object @book
attributes :id , :name
child :questions do
attr...
Prowler asked 4/3, 2012 at 8:55
4
Solved
I'm trying to render a pretty simple data structure using RABL, but I can't figure out how to remove the child root nodes properly. Here are my two templates.
First, the collection index template....
Tybalt asked 12/3, 2012 at 18:58
7
Solved
I have a ruby hash that I'd like to render using RABL. The hash looks something like this:
@my_hash = {
:c => {
:d => "e"
}
}
I'm trying to render this with some RABL code:
object @my_...
2
Solved
I have a Rails app running in Heroku, and a html file using Jquery Mobile.
The Rails app returns JSON data (using RABL), that my mobile app is suppose to pick up and show.
This is what I'm doing,...
Abelmosk asked 22/9, 2013 at 13:55
1
I am using rabl with rails 3.2 application, I am getting errors in rabl view files but it's not pointing exact error line where error occured. So now I want debug view code for the line causes erro...
Nadean asked 30/8, 2013 at 5:56
1
Solved
working on an api, using the rails-api and rabl gems, basing understanding off railscasts 348 and 322
currently getting
Missing template activities/index, application/index with {:locale=>[:e...
Reese asked 26/1, 2014 at 20:40
3
Solved
I'm using Rabl to generate XML output in a rake task:
xml = Rabl.render @listings, 'feeds/listings', :format => :xml
# do stuff with xml
However, I need to use multiple helper methods in the ...
Mechling asked 6/8, 2013 at 22:21
2
To build api for a large scale application, which method is better interms of performance, should i use Rabl, Jbuilder or build json objects manually?I am building api /endpoints for mobile apps.
Tetryl asked 24/9, 2012 at 19:23
1
I have to following rabl code to generate some JSON data.
object @event
attributes :id, :EID, :name, :address, :description, :latitude, :longitude, :time, :created_at
node(:rsvp_count) { |event| e...
Dignity asked 16/8, 2013 at 1:26
2
Solved
Rabl allows you to grab the attributes by naming them in your view, for instance:
object @user
attributes :name, :email
I have a model whose attributes are will not be known, but I'd like to dis...
Langlois asked 6/12, 2012 at 20:10
1
I come from Ruby and have just started testing Spring and find it fairly nice.
However i'm used to being able to customize the rendered JSON output with libraries like rabl and it feels really wro...
Frydman asked 11/7, 2013 at 10:57
1
Solved
I upgraded to rails4 from 3.2.2 and i now get this undefined method from my rabl template that id didn't get before the upgrade.
the "tooth" paramater on procedures is a set by a getter/setter meth...
Cargo asked 16/6, 2013 at 2:44
4
Solved
I have this template:
# app/views/posts/index.rabl
collection @posts => :posts
attributes :id, :title, :subject
child(:user) { attributes :full_name }
node(:read) { |post| post.read_by?(@user) ...
Azimuth asked 16/2, 2012 at 15:8
2
Solved
I use the devise's authenticate_user! method in a controller. This is working fine when the auth_token provided in the request is the correct one but if the authentication fails, I end up with:
cu...
Mirianmirielle asked 6/4, 2012 at 9:50
2
Solved
I'm using RABL in a Rails app to access data via REST. It's working except for the if statement.
I get this error:
undefined local variable or method `matitem_id'
This is my show.json.rabl code...
Quadrat asked 12/4, 2013 at 21:58
1
Solved
I think I have a very basic case when I'm using rabl to return JSON for standard RESTful controller methods...
First let's say I have a typical one to many relationship with parent and child (let'...
Tonguelash asked 27/3, 2013 at 2:49
1
Solved
I've built a JSON API using Rails 3 and RABL
The API works well but on particular requests only part of the data is returned - the rest of the JSON is cut off. Since the JSON is therefore invalid,...
Ephraim asked 31/7, 2012 at 11:18
1
I'm trying to render a rabl view to string in a rails 3.2 rake task. I'm rendering it to string in order to send some JSON through Pusher from a background task. I've looked at various render_to_st...
Elgar asked 3/4, 2012 at 19:11
1
Solved
I have a collection of articles I want to show in my json response. I would also like to export a node about the type of json request asked.
index.json.rabl
collection @articles => :headlines
ex...
Amorita asked 18/5, 2012 at 23:11
1
Solved
I am using Jbuilder (and I also tried to use Rabl) to render json.
When I try to render the jbuilder template in my application it renders
the template within the layouts/application file and retur...
Spheroidicity asked 3/5, 2012 at 4:18
1
Solved
I'm trying to do something like this:
cache "api/v1/cars_index/#{I18n.locale}/car/#{car.cache_key}" do
attributes :id, :brand, :model_name, :fuel, :km, :year, :price
node(:color) { |car| car.col...
Bathurst asked 5/12, 2011 at 10:57
1
Solved
I have this rabl template:
object @photo
attributes :id
child :comments do
attributes :id, :body
end
Which gives me this JSON response:
{
photo: {
id: 1,
comments: [
{
comment: {
id: 1,...
Donatello asked 21/2, 2012 at 23:13
1
Solved
I'm using the RABL gem to render JSON user data for users of comments which are children of annotations which are children of images. I'd like to do something similar to:
object @image
node :anno...
Unbuckle asked 24/2, 2012 at 9:23
1 Next >
© 2022 - 2024 — McMap. All rights reserved.