bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.

Tuesday, February 24, 2015

Components not Controllers in Ember

Months ago I blogged about my experience with randomly pairing with a healthy hacker,  yesterday I concluded another random pairing and with an associate,  @jgwhite. Jamie leads the Ember UK meetup and I was looking for some ember help with my current project.

I am looking to create a database for diverse speakers in tech to share with the steamrolers community.

My specific task was looking to create a save function in my controller so when ever some one creates a new speaker with my speaker form, the createRecord function would fire. Unfortunately that was not happening and actually just throwing an uncaught error.













I spent a good part of my Sunday searching through stackoverflow and forum questions trying to figure out why functions were not working.

After a bout 10minutes of explaining my issue with Jamie, He was able to identify that my problem was due to my save action being nested in a SpeakerController and the form was calling it from the higher application layer. But it wasn't enough, just to replace the save action in the ApplicationController,he recommend to go a step further and create a Component.









I now understand that despite the common comparisons, Ember is nothing like Rails other than the fact they both have opinions. The Controllers work in entirely different ways and come Ember 2.0 the use of Controllers will be removed. I am now able to use the newly created speaker-form component to call my speaker.save() function and even add an a validations like containsInvalidCharater.

Ember is definitely a moving ship, just like all other well maintained Front-End frameworks. The learning curve is high and constantly moving, but the reward with easy prototyping client side applications is well worth it. I am looking forward to using the foundation I am building with this app to create more things with Ember.

If you are new to learning Ember, I would love to pair with you or chat about your app, in effort to pay forward the help I got with mine.

Tuesday, February 17, 2015

Rails API gem

I recently took on the task to create a Rails API gem for an Ember project I am working on. for STEAMrole. It is still very much in the beginning stages but I have both the Rails and Ember playing rather nice together.

Some noticeable differences in the way I started this project was I actually started with the Ember's client side application first. I wish I could say it was rather simple but I did have some hang-ups, specially while working with fixtures. The issue turned out be how was requiring the file,  it wasn't actually an Ember thing. More details here.

At this point I have been writing test and working with the Twitter API to gather some data that is needed for that app. One of the real wins for Ember and other Javascript frameworks is the separation of concerns. I am able to work on the Rails database without concerning myself with the Front-End and vice versa.

My overall experience with the Rails API gem, not only am I able to throw an api together rather quickly with scaffolding. It also sets up some simple controller test to assert true, unfortunately they were written in Minitest. I am not aware if they could be scaffolded into Rspec as of yet, as this is my first Rails API project and I didn't setup rspec-rails yet, but have decided just to follow through with Minitest DSL for this.

The coolest thing about using this gem is being able to see the JSON data in your localhost with not a lot of effort. I highly recommend this tutorial to get you started using the Rails API gem, feel free to skip the Ember stuff if that doesn't excite you.

I am not finished with my current project, but If you interested in seeing one of my Rails API project live, check out Interpersonal Movie Database.

To get started do the follow:


Friday, February 6, 2015

Updating your git on OSX

Do me a favor and type "git version" in your terminal

If your git is not later than 2.0, then you will need to the following:

I have updating my git so many time this past year and did not realize my mac was not recognizing it. This is because git is pre-installed in the mac dev kit installed with Xcode. I found a forum which describes this in answer.

I follow the instructions now mac is now using git 2.3.0.

RVM

I wrote this tweet during my first month into web developing learning. Looking back now I can laugh at my ignorance, because I absolutely love RVM and being able to switch my rubies on the fly. It took some time but I now feel a lot better at working in the command line and installing package like RVM.

I recently spent some time pairing with a fellow Code Newbie and found RVM to be very helpful in debugging their issues.

If you are using or learning Ruby I highly recommend the use of RVM.

Use this path to install RVM:

$ \curl -sSL https://get.rvm.io | bash -s stable

*If you ever want to find old tweets, use this link

Faker error

It's been a while since I used the Faker gem for anything and had an error I spent a bit of time on. I kept getting the error "TypeError: can't cast Array to string", but had no idea where that was coming from. I checked my image string and it was fine; I also tried adding in the an Active Model Serializer for my api (but that had nothing to do with it).













I discovered via this blog post, and found out my `Faker::Lorem` call was spitting out an array and I assumed it was a string. I switched it up to `Faker::Lorem.words(2).join(" ")` and all is well.

Simple solution I know, but I spent long enough on this to make sure it was in a blog post to prevent future mistakes.

Tuesday, February 3, 2015

I can open web pages in vim

I feel as if each day I use vim I use the trackpad even less. I just discovered about the command to open chrome and open specific webpages. I will be having a lot of fun with this, but thought I should share. 

My leader key is spacebar, so all I need to do is hit "spacebar + ggg" and out pops chrome which will be automatically directed to google.com

" open web pages in vim "
nmap <leader>ggg :! open -a "/Applications/Google Chrome.app" 'http://google.com/'<CR>






*Note: I know you can do the same in Alfred, but this is VIM!

Monday, February 2, 2015

The New Ruby Newbies

After 2 months of inactivity I have decided to take the Ruby Newbies group down a different path. When I first started the Youtube chats a year ago, I was looking for other individuals learning Ruby, like myself. I have succeeded in this and now work in Rails as well as other technologies.

The model of scheduling g+ hangouts on air worked before but now does not seem to be a great way to collaborate and chat on topics associated to Ruby. I am just unable to keep up with a consistent weekly schedule anymore, but still want to assist and collaborate.

I will be unveiling a new version of Ruby Newbies, in the form of a Slack Chat. This will gives us the ability to collaborate much faster and receive help when we are stuck on certain hurdles.

*Full disclosure, I plan to make this a paid community in hopes to keep out the lurkers and less driven learners. The fee will be small and one time, but until then I am opening it up to the first 15 people who sign up as a beta test. I will then officially open it up for everyone to sign up next Monday the 9th.

All future events and announcements will be posted within the slack chat community.

If you are interested checkout the new Ruby Newbie page.