Category "ruby-on-rails"

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

Errno::ECONNRESET: Connection reset by peer in Rails using rest-client

We have a Ruby on Rails application and this has a "search" functionality (search for some company). From browser user key-in some name and hit search and this

How to set up importmap-rails in Rails 7 engine?

I have opened an issue in the importmap-rails gem github repository here about this but thought I'd throw the question out here in case anyone might have a work

Rails Query group and pluck to Return Array of IDs grouped by another attribute?

I know that Model.group(:account_id).count will return a hash of account_ids => counts. {3=>3, 4=>3, 8=>8, 10=>5, 20=>4} I'd like to retur

Why can't I display my ruby on rails app on localhost?

I'm trying to display a very simple app from codecademy and this is the error I'm getting in my browser: PagesController#welcome is missing a template for requ

Can I slugignore `node_modules`, `tmp` and `storage` folders?

I want ways to reduce my slug size, and I was wondering if it will be ok to ignore those folders /node_modules, /storage, /tmp, or will that bring me some issue

Setting session timeout in Rails 6

I need help on the timeout configuration on the rails 6. I tried to configure the /config/initializers/devise.rb, but it's not working, any assist will be appre