Category "ruby-on-rails"

Generic Ruby solution for SQLite3 "LIKE" or PostgreSQL "ILIKE"?

I am using SQLite3 for development and PostgreSQL for deployment. However, I am facing the following problem: My simple search using SQLite3: def self.search(

Connecting to WSL2 server via local network

I'm developing a rails app using WSL2/Ubuntu on my Windows 10 machine, which is great! The problem is I can't connect to my server from another computer in the

Ruby on Rails session[:counter ] increases by two

I am studying pragmatic bookshelf lessons. I try to make a session counter. my store controller is class StoreController < ApplicationController def

Why it runs twice when seed in rails?

I just put puts "test" in the seeds file , when I run rake db:seed, I saw there are 2 lines "test"

Rails: simplest way to put a blog on a subdomain

I've been digging around on subdomains in Rails for a couple days and haven't found a good explanation of this yet... I have a rails app which has a blog integ

Stripe recurring/subscription billing best design/practices?

I'm coming off putting together my first site with stripe, but I feel like I could have designed my stripe integration much better than I had. The main issues t

is there a way to set after_commit callbacks to a specific ActiveRecord transaction

I am creating a ActiveRecord transaction this way ActiveRecord::Base.transaction do MyModel.create!(name: "value") OtherModel.create!(name: "value") end

Bundler could not find compatible versions for gem "bundler":

Complete new person to Ruby and Rails here... Have tried some tutorials in the past, but that's about it. I'm trying to follow 'Ruby on Rails 3 Tutorial' book

<%= stylesheet_link_tag "application", :media => "all" %> <----- This piece of code is not allowing my ROR application to load locally

After installing Twitter bootstrap, I ran 'Rails server' and now the application will not load. This is the error cannot load such file -- less (in C:/Sites/c

Failed to build gem native extension: Unable to install Rails + MySQL2

I am on MAC OS X LION and keep getting error message Failed to build gem native extension when trying to install rails and mysql. This is what I am doing. I en

How do I dynamically add my Ngrok tunnel to config.hosts in Rails 6?

I'm trying to whitelist my ngrok tunnel hostname in config.hosts but it changes every time I start Ngrok. Is there a way to get the public url of my Ngrok tunne

Rails: select unique values from a column

I already have a working solution, but I would really like to know why this doesn't work: ratings = Model.select(:rating).uniq ratings.each { |r| puts r.rating

Designer learning Ruby on Rails?

I already started learning online but everything out there seems oriented to developers not designers with no baggage. I'm a graphic designer and I'm coding re

What happens after I add an index to a large table in a production Rails app and then migrate?

Rails 3.2 app running on Heroku with Postgres. I added an index add_index :lines, :event_id Events have_many Lines. There are about about 2 million Lines and

Rails i18n inflections for error messages

Does anyone know how to define a gender for the attributes in a model? So when error messages appear I can give them a specific gender such as: La direcci&oacut

C:/Ruby30-x64/bin/ruby.exe: bad interpreter: No such file or directory

I'm new to rails. Error -bash: /mnt/c/Ruby30-x64/bin/rails: C:/Ruby30-x64/bin/ruby.exe: bad interpreter: No such file or directory I'm trying to run server on m

How to install jQuery and bootstrap in rails 7 app using esbuild (without webpacker)

I'm trying to create a rails app by installing bootstrap and jQuery. First I tried to create using rails new name--css bootstrap But its not working. So I did

Find version where specific attribute has changed in papertrail

I'm using the Papertrail gem in my project and have searched extensively to try and find how to do the following. What I'd like to do is find the version of my

Need a less repetitve way to start Rails on Mac

I've been on a Mac just over a month and before that I've been using Windows and wrote a .bat file to run a few other little .bat files to fire up MongoDB, guar

sass-watch: command not found whenever I run sass-watch

I have Ruby and sass installed already, but I'm getting a sass-watch: command not found Whenever I run sass-watch . Any ideas?