Questions tagged [jbuilder]

JBuilder is a IDE for Java developed by Embarcadero Technologies. It is also the name of a Ruby library for producing JSON.

JBuilder is a Java IDE from Embarcadero Technologies. It was originally developed by Borland in 1997, and now belongs to Embarcadero Technologies.

Jbuilder is also the name of a Ruby library that lets you "create JSON structures via a Builder-style DSL".

335 questions
0
votes
1 answer

Using rendered JSON in rails view conditional statement

I have a jbuilder view that returns json which is dynamically rendered in a partial. One of the json attributes is called in_list, which is a boolean value. I'd like to conditionally render a button depending on the value of that boolean. It looks…
Daniel Bogart
  • 1,295
  • 3
  • 18
  • 41
0
votes
1 answer

How do I design a ruby equivalent objects for this json structure

I have a json structure that I need to build up based on url parameters provided by a client. Currently I've been building the json structure out using Jbuilder.encode but it's getting pretty hairy. self.query = Jbuilder.encode do |json| …
Horse Voice
  • 8,138
  • 15
  • 69
  • 120
0
votes
1 answer

Connecting Rails backend with Angular frontend

I'm new to Angular, and I'd really appreciate some help in connecting my Rails backend with my Angular frontend. In my Angular controller, I want to retrieve JSON data from my Rails backend. Using, jbuilder, I am able to retrieve JSON from this…
Matt
  • 811
  • 2
  • 11
  • 20
0
votes
1 answer

Checking values of hash before show in jbuider , Ruby on Rails

I have a jbuilder to show my object. Thats how it looks (part of it) o = @property_object json.features o.property_object_feature_pack, :pool, :garage, terrace and this showing me next: { features: { pool: { params: null, present:…
Alex Baidan
  • 1,065
  • 7
  • 15
0
votes
1 answer

rails 3.2 with jbuilder swallowing errors, instead rendering missing partial

I'm using Rails 3.2.21 with JBuilder. I have an example where I'm using an a JBuilder partial inside of a js.erb file to pre populate some fields: var orderData = <%= raw render :partial => 'orders/orders', formats: [:json], handlers:…
earnold
  • 1,440
  • 1
  • 15
  • 26
0
votes
1 answer

Best Method to write an API application in Rails

I am planning to start a pure API only application using Rails4.2. As its a API application external clients makes requests to the app, no views are involved in the application. I would like to know what is the best method to build the application.…
Sooraj Chandu
  • 1,348
  • 16
  • 35
0
votes
1 answer

jbuilder: create json array

I am trying to use jBuilder to create a json file, and i can make the relationship "belongs_to" to work, but i don't what i can do for the "has_one". So I have a Solution model: class Solution belongs_to :user has_one :world end I used this to…
Lisa
  • 2,809
  • 3
  • 24
  • 37
0
votes
1 answer

How to update FullCalendar events using a search function?

I have my search set up like so. # Viewings controller def index @rmquery = params[:search] if params[:search] @viewings = Viewing.search(params[:search]) else @viewings = Viewing.all end end and class Viewing <…
Mitch
  • 53
  • 9
0
votes
1 answer

format jbuilder with code, message and data

i have the following jbuilder class: json.array!(@users) do |user| json.user_id user.id json.user_name user.full_name ... end But i want all @users data inside a :data attribute. And a code and a message for the response. Exactly like…
ntonnelier
  • 1,539
  • 3
  • 23
  • 49
0
votes
2 answers
0
votes
1 answer

AJAX not rendering as it should

I am at a loss with what’s stopping my code not rendering AJAX where it should be, I have a less serious JS ‘Parse error’ which I can’t work out also. I have a default prevented rails form_for where upon submit event jQuery finds the element and its…
jbk
  • 1,911
  • 19
  • 36
0
votes
1 answer

how to render partial and a variable on same page using jbuilder gem

I am using Rails 4, ruby 2, and jbuilder gem to respond json. I have a file index.json.jbuilder in which following code is written json.partial! "apis/contents", comments: @comments json.name @name Returning following error :- no implicit…
Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39
0
votes
1 answer

Build correct JSON

I try to render a correct formatted json: render json: {photo: @photo.as_json(with_thumbs_url: true)} In my model I have to do this: def as_json(options={}) if options[:with_thumbs_url].present? Jbuilder.encode do |json| …
John Smith
  • 6,105
  • 16
  • 58
  • 109
0
votes
1 answer

grape-kaminari with grape-builder

Is there a way to get this grape-kaminari to work alongside the grape-jbuilder gem? I've tried just paginating the records in the actual API module endpoint: resource :groups do desc "Return a list of groups belonging to your company." get…
JonathanSimmons
  • 1,528
  • 1
  • 16
  • 28
0
votes
1 answer

Registering a user through Rails API and returning validation errors

I'm trying to build a controller action which will create a new user in my application. I want it to attempt to create the user and if it succeeds, return the User model and if it fails show the validation errors. So far I've got this mostly up and…
John Dorean
  • 3,744
  • 9
  • 51
  • 82