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

how to store json response to javascript variable and display

How to get json response in javascript variable? This is my index.json.jbuilder file `json.array! @properties do |p| json.id p.id json.Space_name p.Space_name json.address p.address json.city p.city json.state p.state …
SreRoR
  • 1,151
  • 1
  • 17
  • 44
0
votes
1 answer

Jbuilder Rails - Verifying boolean

I need to render a JSON in Rails but before I want to verify a boolean from my class, (e.g. Stores) which have "published" boolean. I've tried something like that: json.extract! @store json.store do if @store.published true …
Gehlen
  • 160
  • 1
  • 15
0
votes
1 answer

Array of hashes where hash is returned by a function in jbuilder

I have a PORO TutorProfileHandler that has a function json that returns a hash. class TutorProfileHandler def initialize(opts) @profile = opts[:tutor_profile] end def json tutor = @profile.tutor return { …
Richard
  • 828
  • 1
  • 8
  • 28
0
votes
0 answers

Why?, I can not access the properties of a one to one in jbuilder, Rails 4.2.5

I have a API developed in Rails 4.2.5 and in this problem, I try to show all users, but each user have a relation one to one, for example one user have one profile, and when I try to access, for example to name that exist in the relation, I can not,…
Rul
  • 157
  • 1
  • 2
  • 10
0
votes
1 answer

Get nested Arrays in JSON

I have an object (Institution) and I want to get the 2 arrays (marks and attachments) that are relationed with this object using JSON. To be clear: For 1 institution, I have 3 marks and for every mark I have an attachment. Here's my code of JSON…
developer033
  • 24,267
  • 8
  • 82
  • 108
0
votes
0 answers

Rails jquery-ui autocomplete

Hi I have been searching for a while now I do not understand why my autocomplete does not work using jquery-ui and rails. Lesson.rb: class Lesson < ActiveRecord::Base def self.search(term) where('LOWER(title) LIKE :term OR LOWER(artist) LIKE…
Snake
  • 1,157
  • 1
  • 10
  • 21
0
votes
1 answer

Nesting associations in JBuilder with Rails

I have the following json jbuilder: json.question_cluster @question_cluster json.questions @question_cluster.questions do |question| json.id question.id json.title question.title json.required question.required json.has_other…
Patricio Sard
  • 2,092
  • 3
  • 22
  • 52
0
votes
1 answer

Rails include through Jbuilder partial

I have a jbuilder show that renders a partial: json.contents @item_trackers, partial: 'item_trackers/item_tracker', as: :it In this partial I access my pages_trackers association through the it variable: json.pages …
Francois
  • 1,367
  • 1
  • 15
  • 23
0
votes
1 answer

Rails render jbuilder in action

I want to push to websockets what normally would be returned from a jbuilder view when the route is called but I cannot call render twice in an action: def ... @resource_receivers =…
Mohamed El Mahallawy
  • 13,024
  • 13
  • 52
  • 84
0
votes
1 answer

create.json.jbuilder not returning object?

def create @practice = Practice.new(practice_params) if @practice.save && @practice.start respond_to do |format| format.html { redirect_to practice_learnings_path(@practice) && return } format.json end else …
Vivek Goel
  • 13
  • 3
0
votes
1 answer

Jbuilder: json.variable instead of json.name

I'm using jbuiler to generate api, when I go generate a value, I do: json.name type.name I'd like to use the value type.name, for example, to generate the name of the value, this way I could generate an array with the name of my…
Fernando Aureliano
  • 894
  • 12
  • 35
0
votes
1 answer

How to ensure an object always is there, even if empty

I have a jbuilder template which conditionally renders a partial. json.current_user do # ... json.avatar_urls do json.partial! 'api/users/avatar_urls', avatar: user.avatar if user.avatar end end When there is an avatar, the resulting JSON…
berkes
  • 26,996
  • 27
  • 115
  • 206
0
votes
1 answer

rails helper to populate json feed

I would like to use a helper method to dictate which links are available to my json feed. I had this set up using standard html like this .......... if shopping_request.new? content += accept_shopping_request(shopping_request) content…
rico_mac
  • 888
  • 8
  • 22
0
votes
2 answers

Odd Jbuilder Response - RubyOnRails - Jbuilder Gem - JSON Response

class LineItem def stock_status 8, true end end Template json.stock, json.required_stock = line_item.stock_status Response stock=: 6, required_stock=: true Want the response to be stock: 6, required_stock: true
chirag7jain
  • 1,485
  • 3
  • 26
  • 43
0
votes
1 answer

Refactoring multiple render in controller

In my rails controller, I have to check after getting @group with before_action that this group is not system. But I have lot's of repetition in my controller. I've tried to turn into a separate method but I get the classic : Render and/or redirect…
Mio
  • 1,412
  • 2
  • 19
  • 41