Showing the file name before committing to an upload of a CSV file in Ruby on Rails

Last Updated on September 16, 2020 by Christopher G Mendla

I was working with a Rails App where the user would select a category for an upload and then upload the CSV file. I wanted to show the user which category they selected along with the file they are attempting to upload. Tags: Read more
Read more

Shading Cells in Ruby on Rails depending on the contents of the cell

Last Updated on September 16, 2020 by Christopher G Mendla

I wanted to change the background color of a cell in Ruby on Rails depending on if the contents of and expires field was past or not.  This could be useful for dashboard type apps or pages. i.e. red/yellow/green

Tags: Read more
Read more

Site Monitoring with Ruby on Rails

Last Updated on September 15, 2020 by Christopher G Mendla

I needed a way to show the status (Up/down) of internal Ruby applications.  I found an answer on StackOverflow that pointed me in the right direction (Apologies that I can’t locate that post). . I modified that somewhat by putting it into a method and passing the site name to it.

Tags: Read more
Read more

Form tags in a ruby view need to be outside of any table elements or the form/submit button will not work.

Last Updated on September 15, 2020 by Christopher G Mendla

If you are using form tags in a ruby view, they need to be outside of any table elements or the form/submit button will not work properly.

Tags: Read more
Read more

Validating CSV imports in Rails

Last Updated on September 3, 2020 by Christopher G Mendla

I needed to validate CSV files that were being imported into a Rails app. The validation was simple: Look for blank entries, ensure columns used for associations (IDs) were integers and check that certain other entries were numeric.

The first thing I checked was to make sure that the header of the CSV file matched what we expected. The simplest way to do this was to set an ‘expected header’ and then check the header on the CSV.

Tags: Read more
Read more

The importance of using Railsdiff.org when updating your Rails version

Last Updated on September 2, 2020 by Christopher G Mendla

Whenever you update your Rails version, you should always use Railsdiff.org. The importance of this cannot be overstated. Railsdiff will provide a list of ALL of the changes required to your rails code. 

Tags: Read more
Read more

Use the Bundle Outdated command to keep your Rails applications secure

Last Updated on August 26, 2020 by Christopher G Mendla

Using outdated gems in your Ruby on Rails application introduces vulnerabilities to your Rails Applications. There is an easy way to find outdated gems using the Bundle Outdated command.

Tags: , Read more
Read more

Active Storage in Rails 5.2 DOES NOT SUPPORT VALIDATIONS

Last Updated on January 19, 2020 by Christopher G Mendla

You have to be kidding me.. I just found out that Active Storage in Rails DOES NOT SUPPORT VALIDATIONS.

Tags: Read more
Read more

Adding icons for editing, deleting and saving records in Ruby on Rails

Last Updated on November 30, 2019 by Christopher G Mendla

When you are working with Ruby on Rails and run a scaffold, you will have edit and destroy options on each resulting record in the index for that particular scaffold. The edit and destroy links are simply link_to’s that point to the appropriate action. The issue is that the words ‘edit’ and ‘destroy’ or ‘delete’ will sometimes take up some valuable real estate.

Tags: Read more
Read more