Skip to main content

All Questions

Tagged with
-4 votes
1 answer
97 views

Replace NULL with NIL when using JSON or Hash [closed]

I have the following JSON and I'm trying to replace null with nil because ruby can't compile it. I get the following error undefined local variable or method "null" for main:Object (...
Robert's user avatar
  • 439
0 votes
1 answer
168 views

Sending data from Rails to get validated in JSON Schema

In my app I am sending product information in various types (string, integer, float, and boolean) for validation by a JSON Schema. I noticed today when attempting to send false boolean values for ...
dukehenry's user avatar
0 votes
1 answer
282 views

i can't render partial js from controller rails 7

I've created my_portfolio.html.erb with form submission to controller with remote: true , the controller take the params and verification everything work fine with condition and code, but it's can't ...
LAX's user avatar
  • 3
0 votes
0 answers
50 views

Why I see ajax response instead of view in my RAILS 5 app

I have button which submit login form. This button generate POST request for my session controller Started POST "/login" for 127.0.0.1 at 2024-04-03 10:49:13 +0300 Processing by ...
Anderson's user avatar
  • 135
0 votes
0 answers
125 views

Code change works in local machine but not in staging server

In a predetermined format, csv files can be uploaded and in the process it gets pursed through an algorithm every time we upload a dataset. One of the categories for check is the name of the countries ...
NaderaTany's user avatar
1 vote
1 answer
303 views

Anyway to get JSON schema to recognize null OR string type as valid without using type "null"

I understand that the typical response to this is to use "type":"["string", "null"] But the OpenAPI version we have is 3.0.x, not 3.1 so the type of null is not ...
Rockwell Rice's user avatar
0 votes
1 answer
62 views

Cannot use the helper method `current_user` in devise

I am building a simple todo app with nextjs and rails. I am using devise for user authentication, but I can't use current_user. Specifically, I am using JSON API Serializer to return user information ...
Tsubasa's user avatar
-1 votes
2 answers
253 views

How to convert large active record data to json format - laptop get stucked and get hang during data.to_json - export, import in ROR

user_mails = UserMail.all data = {user_mails: user_mails} File.open("demo_data.json", "w") { |f| f.write data.to_json } json_data['user_mails'].each do |data| UserMail.where(...
Prathviraj Shettigar's user avatar
0 votes
0 answers
73 views

Recover from Rails JSON ParserError Caused by Tabs

What is the best way to recover from JSON with illegal characters (like tabs). Would it be reasonable to simply escape the tabs on failure? Please advise: module ActiveSupport module JSON class ...
jrhicks's user avatar
  • 15k
0 votes
0 answers
35 views

Deep search for a value in a hash [duplicate]

I would like to analyze several hashes to extract certain specific information. These hashes have a global tree structure, however each of the branches of this tree structure is not always present in ...
h3lt3r-sk3lt3r's user avatar
0 votes
1 answer
117 views

ERROR: could not identify an equality operator for type json

I'm getting the error ERROR: could not identify an equality operator for type json when launching the SQL query update pdfs set forced_payload = datatable.forced_payload, s3_original_path = ...
Mathieu's user avatar
  • 23
0 votes
1 answer
58 views

How to pass ids and names to d3 from rails

As with any rationalized database, the IDs, names and data are stored in separate tables. The current script (below) shows the IDs in the legend but I would like to pass in and show the names. The ...
Anne Lalsingh's user avatar
0 votes
3 answers
236 views

How to parse json string data having symbols as key instead of string in Ruby?

Here's the json string example json = "{:status=>\"ok\", :hitcount=>\"1\", :request_date=>Wed, 10 Oct 2019 00:00:00 +0000}" I have tried below mentioned snippet ...
Mohammad Arif's user avatar
0 votes
1 answer
167 views

Ruby: How to pass parameters to oj_serializers

I'm using Oj Serializer: https://github.com/ElMassimo/oj_serializers. I want to know how can I pass some variable(eg. CurrentCurrent) from controller to Serializer? This for example controller: class ...
Steven's user avatar
  • 13
0 votes
0 answers
163 views

Rails eager loading detected when loading

I have these errors when loading page. USE eager loading detected Notification => [:actor] Add to your query: .includes([:actor]) Call stack .../views/api/notifications/index.json.jbuilder:6 ...
Romeo's user avatar
  • 349

15 30 50 per page
1
2 3 4 5
341