Skip to content

An Inseparable Peace

Primary Menu
  • Home
  • About
  • Contact

Tag: Rails

TIL: Running Rails 5 / Ruby 2 on Ubuntu 2022.4

Posted on October 29, 2022October 29, 2022 by Karl

I saw an article that Ubuntu 2022.10 had been released, which spurred me to finally upgrade my Dell laptop from 2018.4 to 2022.4 Everything went great!… until I went to write some code.

Continue Reading

TIL – Generating a Model that `references` an Alias

Posted on October 16, 2022October 16, 2022 by Karl

Let’s say you have a Business class in Rails..and maybe you want to records mergers, so you want to create a Merger class. Normally, when we create a model, we use the references type: so rails will automatically create both the <model>_id fields and the index: In this case though, we don’t want to reference […]

Continue Reading

TIL – Using a Cloudinary Resource with the Wicked PDF Gem

Posted on May 26, 2022October 16, 2022 by Karl

Today I was working on an pdf.erb view template in rails. In this case, I wanted to add into the PDF some images that we stored in cloudinary. My first instinct was to use the image tag that’s part of the cloudinary gem: However, the image would not display. Since I’ve rendered images in other […]

Continue Reading

Rails Migrations: Set a Default Date for a column

Posted on December 31, 2021May 26, 2022 by Karl
Continue Reading

The Shared Green: Rails Polymorphism Commons

Posted on August 29, 2021May 26, 2022 by Karl

When writing a Rails app I love polymorphic relations. If there’s a good chance I can reuse a model with other objects and I can’t make it a PORO (plain old Ruby object), my relation of choice is likely to be a polymorphic one. Once challenge with polymorphism is documenting the interface future objects will […]

Continue Reading
shallow focus photography of computer codes

Is Your Rails Form not Rendering Correctly? Check your HTML

Posted on June 27, 2020May 26, 2022 by Karl

I’ve recently had two instances where I’d create a form: but when I look in my browser, no form tags have been created!

Continue Reading

Rails 5, Postgres, & Windows Subsystem for Linux

Posted on March 8, 2019March 9, 2019 by Karl

So my wonderful 6-year old Dell XPS 13 Developer edition’s soldering at the power port finally gave way, leaving me with a fully function laptop with only one little issue that it can’t get power. The sent me packing to my ‘backup’ Windows 10 laptop. I really wanted to keep working in a Linux environment […]

Continue Reading

Using StimulusJS for Type-ahead Search (2/2)

Posted on February 13, 2019 by Karl

The Rails Side I’ve recently started using StimulusJS as the web framework for a Rails 5.2 application. In Part 1 I built a simple type-ahead search form. In this second half I walk through using a controller and partials to render the results, just like a traditional Rails app.

Continue Reading

Using StimulusJS for Type-ahead Search (1/2)

Posted on February 11, 2019February 12, 2019 by Karl

Part 1 – The Front End I’ve recently started using StimulusJS as the web framework for a Rails 5.2 application. My first task with it was to build a simple type-ahead search form.

Continue Reading
Copyright all rights reserved | Theme: Minimal Blog by WPinterface.