Category "ruby-on-rails"

Rails: may have been in progress in another thread when fork() was called

After I upgrade to OS10.14, I got this error when I called Httparty response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow')

Invalid request parameters: invalid %-encoding when upload file to Rails api only server

I am working on web app that use Reactjs as a front-end and Rails5 api only app as a back-end This is the data that i send to the server as Request payload --

Unable to autoload constant ActiveStorage::Blob::Analyzable Error with Rails 5.2, AWS S3, and ActiveStorage

I've been battling this guy for a while and have done all the Googlies on it (here, here, and many equally-unhelpful others) but to no avail. The official erro

Rails: JSON round trip from database to TEXTAREA converts to string on second save

(Rails 5.2) My record with JSON is saving correctly to the (Postgres 9.4) database on CREATE but is getting reformatted after UPDATE, with carriage returns (\r)

What is the return value of update_all() in ActiveRecord / Ruby on Rails?

The Ruby on Rails and ActiveRecord documentation, Google, and StackOverflow are conspiratorially silent on the return value of update_all() What does update_al

Factory Girl pass parameter to trait

I've been banging my head over this. I want to be able to overwrite attributes on top of traits. I've been reading the documentation and some internet examples

Uninitialized constant User::ChatRoom

I get this error NameError (uninitialized constant User::ChatRoom): app/controllers/users_controller.rb:20:in `create' Here is my user.rb file class User in

Use both Tailwind and SCSS with cssbundling-rails

In the Rails 6 project I'm working on, we're looking upgrade from webpacker to cssbundling-rails and jsbundling-rails. We currently use Tailwind with SCSS, but

Search Fullname, in two fields firstname, lastname rails

I'm working a search box for my application i have two fields firstname and lastname. I create a full_name method for them. Profile model: def full_name "#{se

missing required option :name

I am trying to set up AWS, and carrierwave to upload pictures from my website. I keep getting the error 'missing required option :name' when I try to upload/upd

Ruby 3 - Save without validation no longer works on one table

I am upgrading an application from Ruby 2.6.10 to Ruby 3.0.4 and have a very odd situation. When I execute the command record.save(validate: false) on one of m

Arel - How to coalesce a field and a string literal in an Arel query?

I inherited a big, complicated Arel query that pulled from a number of tables. A new requirement says that if one of those tabels doesn't have a value for a par

Problem with Creation form (Simpleform) PG::NotNullViolation: ERROR: null value in column with Rails

Hello i have an issue with my app Rails when i try to create an "Enfant" who belongs to an user and a Nounou but my problem is when i create an "enfant" i'm a u

Unable to search on whole database with searchkick as it limits to 10000 records

Unable to search on whole elastic search DB just by using SearchData.search('yamaha', match: :word_middle,load: false) This limits the search to 10000 records

Rails SQL "select in" across several columns: where (code1, code2) in (("A", 1), ("A", 3), ("Q", 9))

I have a business requirement to select records based on two fields in one table: code1 and code2. The selection is complex and hard-coded, with no codeable rhy

Adding inline image with Caracal in Ruby on Rails

I'm trying to get text to show up in-line with an image using the Caracal ruby gem. It currently does this: But I need it to instead do this instead: (accom

Exception: ActionDispatch::Http::MimeNegotiation::InvalidType

I have error report in Sentry. How can I fix it? ActionDispatch::Http::MimeNegotiation::InvalidType {#context['com.opensymphony.xwork2.dispatcher.httpservletres

Rollback entire transaction within nested transaction

I want a nested transaction to fail the parent transaction. Lets say I have the following model class Task < ApplicationRecord def change_status(status,

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor