Challenges I experienced while updating my about page

Monday, January 26th 2015

When I started building my blog with Ember and Rails I had a nice little master plan for it in my head. You know that feeling when you get really excited about a project and just start listing off features you think would be awesome? What I just rolled out was one of those little features. I tied my timeline on my about page into my blog so I can update, add, and remove items using the system. I'd like to share some of the challenges I came across while building it out and what I think I can improve on.

Writing a new bio is actually kind of hard

Writing a bio was a lot harder than I anticipated. I couldn't quite figure out what I should highlight about me in a few lines of text. I also fought with what is too much or bragging? What I have now is very much a work in progress!

Layout isn't really easy

Laying out the timeline cards might have been the hardest thing I had to deal with when building this out. You probably just made a weird face like "Dude, it looks almost the same as before??". That's because I played with a ton of different layouts and finally settled with a slightly altered version of what I had before.

I browsed through many different sites to try and pull inspiration but I couldn't find anything solid that I liked. The solution I came up with I like enough, but don't be surprised if it changes again.

Fighting with the inflector

Rails does a lot of magical things and one of those magical things is making resources plural. Here I was trying to just get the data to load on my about page and I kept getting 404s. After I scoured through the rails server log I finally found something that didn't make sense (2 hours later, of course!). I was making requests to timelines and rails was expecting timeline. Boom, right there, it clicked! I solved this by making a change to the ember inflector:

// ember/app/adapters/application.js

var inflector = Ember.Inflector.inflector;
inflector.uncountable('timeline'); //only makes call to /timeline

Dates are fun to work with

Dates are pretty fun to work with...not! They're not that bad if you're working with something like moment.js, but even then you might have weird edge cases. Getting all of these dates between creating them in ember land, sending them to the rails backend as a datetime, serving them through the API, and formatting the data again was a little tricky to working correctly.

After a little tinkering I got it all to play nicely thanks to moment.js and pikaday!

What can be improved?

The code in my rails controllers (posts, timeline, contact) all share pretty similar code. I bet I could refactor this out to a concern and DRY up the code a bit.

Admin views need to be cleaned up UI wise. They're sort of thrown together because no one but me will see it. But I can do better :)

Admin views probably can be turned into partials and cleaned up. Much like my controllers in rails land, my views in ember land are very similar. I bet I could turn these into partials and DRY up the code.