Rails General

This is why you’re here, ain’t it? Then don’t forget this, that and the other thing.
You’ve probably been told that Ruby is a language and Rails is a framework, but truly appreciating that distinction takes time. As you progress you will sharpen your interpretation of what makes Rails, Rails. And as you become more aware of how you can leverage Rails to accomplish a given task, you will want to remember how to do it again in the future. This stack is dedicated to capturing these types of Rails framework revelations. Things that might be found in a Rails guide, if you were the author.

Iterate over a .yml file's contents

07/01/17  Public, Rails General, Ruby General

Let's assume that the .yml file (i.e. code_school.yml) is located in this directory:

config/code_schools.yml

You'll grab the path to the file, and load its contents:

config = Rails.root + 'config/code_schools.yml'
...

1 vote - harrylevine

Nested Rails Params Hash in a Form

06/11/17  Public, Rails General

When implementing a form object approach, you'll want to create a params hash with nested areas for attributes for two different models.

Note the `manager...

1 vote - harrylevine