Learn Rails 5

Went Well

phuze

Do I need an excuse to dive back into OMG's source code? Probably not but somewhat this current goal made me do so. I'm painfully aware of some quirks revolving around the countdown timer.

  • Countdown showing up as NaN on Iphone / Safari browsers. Yup. A pain in the ass. Tried using MomentJS for parsing dates instead. So far, the test on BrowserStack looks positive.
  • Countdown doesn't stop. It would run even when the deadline is way overdue. Like a time loop, it kept counting down some random hours/minutes/seconds, giving that false hope that you still have time left. Maybe it's an unintended feature? >.<

phuze

Tweaking CSS files randomly isn't exactly part of learning Rails 5 but apart from ActionCable, everything else still feels the same! And I just wanted to make progress somewhere so here we go. I have no idea what I'm doing (forgive me for the weird countdown widget color combo) but I'll probably think of a new layout which I can then experiment with here, hopefully.

phuze

At this point of time, I'm wondering if I should start building on top of the existing structure set up around here.

Back then when I created OMG, I went for the straight up MVP. Pretty stoked at how simple and functional it is (at least to me?) but now the itch to revamp is getting back to me. I feel that my attempt to segregate the dashboard / public goal view was done poorly. And based on the feedback I received, there's more that I can do for the UX as well.

Given that there wasn't much activity for a start around here, I put off creating features like following other users and search. I'm still trying my best to stick to the core of what OMG should be about.

  • Focus on one goal at time. As tempting as it is to allow multiple creation of goals, I believe that would be of a disservice to those (especially myself) who gets distracted easily. Shiny object syndrome, anyone?
  • Reflecting on real world, no one would know what you're up to or whether you need any help if you don't escape from obscurity. In OMG, this means posting your progress updates so that it can be seen from the community page. Of course and if there's a lot of activity, there's always a chance that your post would be missed out but that's another problem for another day.

To start from scratch or build on top? Or just learn Rails 5 by creating other random projects? Dilemma, dilemma.

phuze

I've actually managed to upgrade OMG to Rails 5 without much of a problem. Surprise, surprise. Although, the only issue I encountered was with Devise parameter sanitizer. There was a change in the syntax that got me dreading for a while (the typical response after seeing an error page) but was quickly fixed after a quick Google search as usual.

Stack Overflow saves the day once again.

def configure_permitted_parameters
  devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
end

phuze

Went through the entire tutorial. It was awesome! I didn't realize it would be that straightforward but then again, I'll never know the quirks until I try a different project that involves ActionCable. I kinda shy away from ActionCable mainly due to the need for Redis but apparently, Heroku has a free Redis plan so why not right....

phuze

Oh great. An ActionCable tutorial by none other than Michael Hartl! His Rails tutorial was one of my main resource in learning RoR, giving me some foundation which led to the multiple creation of other random web apps, including this one. Time to sink in and learn some ActionCable!

https://www.learnenough.com/action-cable-tutorial#sec-websockets_and_action_cable

phuze

Was looking around at tutorials on ActionCable and I ended up on a website that's similar to Railscast. Pretty happy with my discovery :)

https://www.driftingruby.com

phuze

You know you've not looked at your code for ages when you're unsure how things are triggering. For a moment, I was dumbfounded by the fact that OMG is sending out welcome emails while I was struggling to find out where it came from in my local source code.

The next wisest thing (which wasn't really obvious right from the start) was to just pull the source code from the hosting environment.

Surprise! My local source code wasn't up to date. But where was the latest changes pushed from? I can only conclude that I made the push from somewhere else. I don't want to lose sleep thinking too much about it :(

Moral of the story? Stop being lazy and always push the master branch to a remote git repository like Bitbucket or Github. Of course, that wouldn't matter if we don't perform a git pull from the updated source, may it be the remote repository or the hosting environment itself...

phuze

To be honest, I've been shying away from Rails 5. Its either

  • I was waiting for dependency gems to be compatible with R5
  • I have no idea what I want to try out with R5

Well I've not been on the development end that much. Although, I do feel the itch to just create something for fun. I've not really explored Rails 5 despite following a tutorial to create an API which was pretty straightforward.

For a start, I can upgrade OMG to Rails 5. That would be fun, considering that I don't have test coverage (oops) and I'd probably break things here.

And of course, there's action cable. Would be nice to have some real time element and perhaps replace the polling strategy that I'm using for notification. Well I better not have too much on my plate. We know how that would usually turn up......