All over the web in programming forums, tutorial sites, and instructions on related things, you’ll hear all about this famous guy that everyone knows. Some dude named json. First off, why this jerk won’t let anyone spell his name with a capital j, like you are supposed to, is beyond me. Already I don’t like him. And why should I send him anything? All the APIs think he’s the best guy in the world. It makes me wonder why json, or Json (corrected) isn’t the svelte guy in the Dos Equis commercials, the way everyone talks about him. He’s not that special. And another thing, he wants to be all new-fangled web 2.0 and not add the “a” to his name like everyone else. See, I told you he’s a punk.

…[somehow stumbles on the fount of all wisdom and flawless knowledge, Wikipedia and ends up on the json page. Face turns red. Embarrassed-o-meter pegs 1o. Tries to backpedal.]

So, I guess that JSON guy is, well, alright after all. I didn’t know he was cool, but now I get it. Apparently his name is fine without the “a” and should be all caps (if that is his real name). Also, he isn’t a guy at all. Well, this has been a very revealing day. Now I get it. I guess, as with programming, you have to spell things correctly, and also not assume things are spelled wrong. JSON is an acronym, not a person’s name. Though I could see newbs being confused by that one. It is the strange leap of logic and conceptualized ideas that throws people for a loop. More of us programmer types need to help people understand more and level them up instead of ignoring their “dumb” problems. Solution to dumbness => provide ways to become smart.

Cross-posted on Myrth.net (where everyone — programmers included — has more fun).

I’ve been working on completing Michael Hartl’s killer — and free — rails 3.2 tutorial for a while now. When I learn new concepts I have to write them down so I won’t forget and will have a reference to go back to, if I do. This is one of those posts.

To have elements of your web page appear without having to rewrite the same code in each page, web developers (like me) use includes of some kind to insert common bits of code once and it gets dynamically generated by the server. In rails, this is called a partial. You can put things like a footer with links, a header with nav, or other elements in partials and then include them in your main layout to display that code automatically.

You would create a new file in the app/views/layouts folder and name it with an underscore at the beginning. Like zoy:

_footer.html.erb

and then put your footer html in it. Then all you do is add this to your main application layout:

It is that simple. Yay rails!