Some of you may have noticed that it has been quite some time since I’ve posted here. I’ll admit that the folks at Handy have kept me pretty busy, but that’s no excuse for an absence of over six months. Let me say that despite overwhelming evidence to the contrary I truly wanted to write something, and as time passed I started to think deeply as to why I hadn’t done so. Was it really because I was too busy, or was it cause I had nothing to say? That’s when it finally hit me…

I did not make blogging easy enough!

As embarrassing as it is to admit, I will go ahead and list the reasons for my silence. First, I really had no idea when I would post how it would look like on this site. Some of you may know that I’m using a gem called Redcloth in order to format my posts. It’s pretty nifty and allows you to use a simple text markup that automatically converts into HTML. Despite having this wonderful gem at my disposal, I was unable to actually see what a post would look like prior to actually creating one. Let me tell you, it’s not particularly convenient to write in a non production environment and check whether or not your post looks as you intended by submitting over and over and over again. After maybe a thousand times you’ll finally have an idea about whether or not you are ready to make your content live, and that right there is a recipe for an empty blog.

Second, even if I were to start writing something, sometimes I would get distracted, or have to divert my attention elsewhere. After all, you never know what may come up: dinner, a work event, Football Sunday, Blizzard’s release of Legacy of the Void… That being said, when these sorts of things happened, there was no way for me to save my work and come back to it later (besides copying and pasting what I wrote into a text file).

After coming to this realization, I noticed that it really wouldn’t be too hard to make it easier to blog. I just need to take action. So I decided to do something about it. That led to adding the two most obvious features I was missing: previewing and saving drafts.

Now my “New Post” page now comes complete with a “Preview” and “Save Draft” button:



Previewing involved using JavaScript to send my content back to the server where Redcloth could perform it’s magic, converting the plain text into a set of HTML tags. Then I could display the output without having to actually create a post. After hitting “Preview”, the content in the form above would then be rendered like so:



The save draft feature was a little more involved, requiring additional front end and back end changes. In order to make it seem a bit more like a single page application, when saving a draft I’m actually changing various attributes of the form in order to submit to a separate controller responsible for handling anything related to drafts. To see the full front end implementation for both previewing and drafting, click here.

Pretty cool huh? Sure, this was not a major piece of work, but it had a major impact — I’m actually writing now, and that deserves a post in itself. As Ben Franklin once said: “Either write something worth reading or do something worth writing.” I hope you all think I met at least one of those standards.

Till next time!

-d