class Creative

attr_reader :name, :passion, :professions

def initialize(name, passion, professions)
@name = name
@passion = passion
@professions = professions

glenn = "Glenn Langdon", "creativity", [ "conduct orchestras", "play the piano", "write", "code" ])
puts "Hi, I'm #{} and I'm passionate about #{glenn.passion}."

glenn.professions.each do |skill|
puts "I #{skill}."

Rails 5: Mail form on single page app w/ Ajax & jQuery

Adding a simple mail form to a Rails app is well-documented throughout the web. However, there's not as much documentation for a mail form on a single-page app that submits with Ajax. This tutorial will address a quick and straightforward way to put a mail form on a single-page web site.


19 May 2017

Rails 5 blog with Coderay syntax highlighter

If you have a Rails blog, there are many choices available for syntax highlighting to make your code more visually interesting. Coderay has been around a while and is very good at syntax highlighting for the two dozen or so input languages it supports. Ryan Bate's excellent Railcast of 2010 is a bit out-dated in a couple of respects, but the essentials are still valid. I'll demonstrate a quick implementation for the current Rails 5.


11 January 2017

Sitemap for Rails blog

Sitemaps are XML files that provide a map of your URLs to Google and other search engines. They can be especially useful for Rails applications, like a blog, where all the the links may not appear browseable. There are many ways to code a sitemap for a Rails application, but I'll show you a very simple and quick method to get your sitemap up and running in minutes.


31 December 2016

Rails 5: Bootstrap Carousel w/ Rails helper methods

Integrating a Bootstrap image carousel into a static webpage is fairly easy. It's basically copying and pasting from the Bootstrap website, with the developer just needing to add the image links. Even adding the necessary Bootstrap plug-ins to Rails is straightforward. But, what if you want to use the native Rails helper methods, link_to and image_tag? There's a dearth of information about how to keep your Rails app railsy when using this light-weight and flexible Bootstrap component.


23 December 2016

Ruby on Rails: Multiple blog post previews on a home page

Having built a blog, I wanted the user to be able to preview 4 blog entries on the landing page. Not wanting to hard code the article paths, I wanted the code to automatically pull the four most recent posts. Some very simple Ruby methods to the rescue.


18 November 2016

Using Heroku, AWS S3, CKEditor and Paperclip in a Rails 4 app

Recently I built a Rails blog with a WYSIWYG editor, CKEditor, that allows a user to upload pictures and post articles via the text editor. CKEditor is one of the full-featured text editors that developers can easly integrate into their applications. For uploads, I chose Paperclip, a powerful file attachment library for ActiveRecord. Since Heroku uses an ephemeral filesystem, static assets such as picture uploads must be stored elsewhere. Therefore, I'll use AWS' Simple Storage Simple, S3.


11 October 2016