All Questions
347
questions
0
votes
1
answer
51
views
Can't access nested JSON Api data: no implicit conversion of String into Integer
Wondering if you could help. I am trying to access all the nested first_names from this API inside of elements:
https://fantasy.premierleague.com/api/bootstrap-static/
Here's my controller code:
def ...
0
votes
1
answer
45
views
To_param or slug doesn't work when rendering JSON from RoR backend
I have a Ruby backend and React frontend. In my Ruby app there is a model Game. This model has a some king of a pretty URL --> like "http://localhost:3000/games/BT526" instead of "...
0
votes
0
answers
198
views
How to render complete Ruby on Rails errors on an API call?
I've built a Ruby on Rails app, with endpoints I can call to get some API responses.
I usually render data and errors like this :
def my_fn
begin
#...computing data...
response = {
#....
0
votes
1
answer
44
views
After fetching JSON data from an endpoint, how do I work with the response?
I'm attempting to implement basic notifications in my App. I have setup a /notifications.json endpoint that serves as an index that returns all Notification for the current_user.
controller:
class ...
-1
votes
2
answers
225
views
Go HTTP Post Request not formatting data properly for Ruby On Rails API
I've built a client in Go to interact with my Rails API. I have a model bar with a single string attribute of test. I'm trying to loop through a series of strings which are the values for the test ...
0
votes
2
answers
218
views
API call - Accessing JSON objects Rails
I am trying to call API to query dataset records so user can find a school in my app.
Basically i'd like to be able find school name matching with their input.
At this stage i have only tried to ...
0
votes
0
answers
78
views
Create a QR generator API for Ruby (2.2.2) on Rails
I have a main Ruby on Rails app, which generates links and associated PDF files. What I want is to generate a QR code for each one of the links, so I can paste them in the PDF files.
I know the ...
1
vote
1
answer
217
views
Adding an attribute to json from joined table
I am trying to provide a json that would contain information coming from two tables:MenuItem, and Partner.
In the json below "partner_number" would actually come from the partner table.
{
...
0
votes
0
answers
33
views
I want to call the same key in all arrays from a JSON that I'm pulling from an API. Something like API_Source["data"][1..4]. How can I do this?
Here is my current code where I'm using the API to seed a database.
@games.each do |game|
Game.create(
local_team: @games["data"][0]["visitorTeam"]["data"][&...
0
votes
1
answer
66
views
Archive .json import on rails api
I'm having problems importing a .json file and saving the data inside it in the api database. My code is like this:
def create
content = JSON.parse(File.open(params[:products]).read)
@...
0
votes
1
answer
27
views
How can I display my search results in rails?
When I write city in field and click button, on page has to be that name of city and another. In my case every time name is New York. When I write for example Las Vegas my link is http://localhost:...
0
votes
2
answers
91
views
Nesting JSON data to send to API
I have a rails API which i'm trying to send JSON data to from a react front end in this format:
{
"user" : {
"email": "[email protected]"
"...
0
votes
1
answer
640
views
- UPDATED - Rails API app create multiple nested records of a different models at once using POST request from the controller
I'm working on an API Ruby on rails 6.1 application, so all of my responses are in JSON. I'm trying to create a level 3 Nested records, meaning I want to create a plan record which contains many days ...
0
votes
1
answer
82
views
how to side load something from another column of the same table when making an api call to a column?
Suppose I have a task table with two attributes one as Id and another as parent id along with other attributes.
Now I have two type of tasks :
One which is main task having parent I'd as null and ...
0
votes
1
answer
255
views
How to make a strip in a response in ruby/rails?
I'm struggling to make up something, and it's that when push notifications arrives to the device, if the title defined by the users has a blank space at the end, the blank space appears in the push ...