I spent some time in Ember tutorials and had plans to have an Ember project built and launch back in January, but some unfortunate life events got in the way.
I am now proud to announce that I have completed my goal of getting an Ember app built and launched in 2015. The app itself if very much in an MVP state and I am looking forward to finish the other features I have planned.
Some of my experiences while working Ember how impressingly fast it is to build a Rails API when you aren't concerned with the asset pipeline or views. Ruby is a great server side language and fast enough for me, but sometimes Rails can be a little much; I highly recommend reading my blog post on the Rails API gem, which makes building an api a breeze.
Most people I have spoken with get hung up with the fact that Ember is constantly changing, which developed a very steep learning curve for learning it. I personally completed the Vic Ramon, Treehouse, ember-cli-101 resources and found them to be enough understand the basics in Ember.
I also spent some time learning form the forms and docs, as wells as attended EmberOrlando a few times.
I was basically at a point where I needed to start an Ember project and start learning things outside a tutorial, which I found to be challenging but obtainable.
My first hiccup came when I tried to connect my sample fixture data. The solution was rather easy and actually kind of silly how simple it was.
My next hurdle actually came when deploying the application to Divshot. I normaly use heroku as my go to deployment vehicle, but heard of the great tools available for ember and more specifically ember-cli. The solution for this was not as simple but I figured it out with help from @robdel12 and @jgwhite.
Takeaways:
Now that I have finally moved into world of modern day "Full Stack Developing", I am exited at the idea of separating the concerns of the api and client-side. This will give me the ability to one day try out the ever so popular React.js or even use the api data to produce an iOS app.
I highly recommend everyone who has been in rails with their head down while Front-end frameworks have been popping like rabbits.
I plan on doing more detail post into Ember and its structure in the future, but if I could recommend one tutorial to get started, it would be the ember-cli-101 book. Its the most up to date and gives you a great understand to how Ember works. It also provides the generator commands similar to Rails, that will help you get started much faster.
If you would like to view the app live, its temporary home is here and will the code is here.
This is my personal blog and journey in learning a new skill, Web Developing. In only 7 months I made a career change into this field by dedicating 25(avg) hours a week in studying Ruby. #All words are my own, except the ones I copy and pasted.
Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts
Wednesday, February 25, 2015
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:
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
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.
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.
Sunday, November 30, 2014
What ever happened to Chuych
I spent a good amount of my learning Rails while hacking away at an idea I had to find churches easier. This idea for a church app was actually the reason that got me started in this journey in the first place, but this app been rejected in the past mont
Back in August I rewrote a lot of the Rails code and even added test for the functionality. I then began learning a lot of new front end techniques and frameworks to eventually redesign the app from the ground up, but I got distracted.
I first got distracted just learning and recently realized I was not spending nearly enough time writing code. The fastest I have ever learned code is by writing it and I have made the decision get back into making apps. I have spent nearly 15hours of logged time rebuilding the design using a bootstrap template ( I was avoiding using bootstrap, but gave in). I now have an app that I am proud of and looking forward to sharing it with actual users.
The irony is that this has been complete for nearly 8 months, but I have been dragging my feet to actually share it and have people use. It's one thing to build an app, but its much nicer to have real people use it, which I have found joy with in RubyNewbies.
I have been putting git flow into practice and focusing one feature at a time, I did not spend my time in TDD as much as I like to since the majority of changes were CSS and not backend. I also set my integration test to pending during that time since I did not have a design in mind, I look forward to going back and rewriting those.
Look out for more post about my rewrite of this app coming soon, specifically the challenges of maintaining an app with legacy code.
Before:
After:
Monday, August 11, 2014
email validations for arrays in rails
Sometimes things just aren't that easy. Rails is definitely nice when you do everything out of the box and do not veer to far from the path; I am quickly finding that there are some things that are difficult figure out.
For example I had a task late afternoon to validate emails that are stored in an Array. I original stored all emails as strings but due to way the Rails Mailer works and the needs of the application, the emails are now being collected using CSV(separate by commas) in a string. I am easily able to split that string using split(",") and serializing that into an array. I am also handling single emails by converting them using the Rails method Array.wrap(). Those 2 methods could be blog post in their selves but I am opting to just explain my next issue.
The trouble with storing the emails in an Array is that it broke all my email validations, which does not check a string of emails, I now am tasked with testing the validations by hand, after discovering that the Active Validator only validates strings.
Validate an array of emails.
emails: ["ilikerobot[at]gmail.com, hello[at]briandouglas.me"]
emails.split(",")
emails: ["ilikerobot[at]gmail.com", "hello[at]briandouglas.me"]
With this being my first major case where Rails couldn't do what, I am considering looking at the Active Validator to see if I can contribute to it and add this functionality, but it might be better as a gem. I am sure it would take longer than a night to implement but it could be a cool challenge to create my first gem and this idea seems simple enough.
My first implementation:
My final implementation *after peer review, it turned out I wrote too much code just to check for the validation of an email :)
I also did the same validation in Javascript, on the client-side.
For example I had a task late afternoon to validate emails that are stored in an Array. I original stored all emails as strings but due to way the Rails Mailer works and the needs of the application, the emails are now being collected using CSV(separate by commas) in a string. I am easily able to split that string using split(",") and serializing that into an array. I am also handling single emails by converting them using the Rails method Array.wrap(). Those 2 methods could be blog post in their selves but I am opting to just explain my next issue.
The trouble with storing the emails in an Array is that it broke all my email validations, which does not check a string of emails, I now am tasked with testing the validations by hand, after discovering that the Active Validator only validates strings.
Validate an array of emails.
emails: ["ilikerobot[at]gmail.com, hello[at]briandouglas.me"]
emails.split(",")
emails: ["ilikerobot[at]gmail.com", "hello[at]briandouglas.me"]
With this being my first major case where Rails couldn't do what, I am considering looking at the Active Validator to see if I can contribute to it and add this functionality, but it might be better as a gem. I am sure it would take longer than a night to implement but it could be a cool challenge to create my first gem and this idea seems simple enough.
My first implementation:
My final implementation *after peer review, it turned out I wrote too much code just to check for the validation of an email :)
I also did the same validation in Javascript, on the client-side.
Subscribe to:
Posts (Atom)




