It’s been an eventful last few days.
Since Sunday evening we’ve been thrown right back into the proverbial lions den. Our Rails classes picked right back up where they left off.
It really is incredible to think that the past five and half weeks have seen me go from knowing practically nothing about Rails to being able to do what I’m doing right now. That my friends is why I think The Iron Yard is riding the wave of the future in regards to education.
But, I didn’t intend to write a blog post advertising The Iron Yard. [if you do want to ask me anything about my experience at The Iron Yard, shoot me an email. You can find that on my about page.]
Now, what I did want to talk to you about is user authentication and catching a bit of a glimpse of the glorious things that are possible.
User Authentication in Rails
Early last week Shelby taught us how to do user authentication using some really nice helpers that Rails provides. It all starts with the has_secure_password “helper”. Then there are sessions (logins) and a few other things that need to be in place. If you really want to read about it here is a link…
In less than 60 lines of code (or so), I can now add user authentication to my rails apps. To be able to restrict actions and access to only users who are signed in is a really helpful thing. Think of how many site’s you use on the internet on every day. How many of them do you have to sign into? Probably at least 3/4 of them…
Maybe I’m overblowing this, but user authentication feels like a huge step forward in regards to what I can build and do.
So What Have I Built Recently?
That is a good question.
This week so far we have been working on building apps that allow the creation of events and photos. The photos need to have the ability to be tagged and commented on. The events need to have the ability to be commented on as well.
Sure, maybe that doesn’t sound like much. Trust me when I say that it is. At least it is for me!
The most difficult thing was using polymorphic associations and has_and_belongs_to_many associations. I could get the connections to work in my console, but when I built the actual view that corresponded with that action… it wouldn’t work.
It turned out to be a fairly simple fix (or collection of fixes) that eventually made everything work. I did learn a lot of ways that didn’t work though!
The home page of the app I built looks like what you see at the top of this page. Don’t be fooled by the soft looking home page… if you peel back the facade you will see a lot of little pieces that make all the “magic” work. Now when people ask me what I do I say… “I do magic things with data and stuff.”
And that’s it for today!
Here are a few more screenshots from my app…
The only thing missing is your voice!