282

282 RR Angular on Rails with Jason Swett


00:42 – Introducing Jason Swett

  • Angular on Rails
  • Use the code “rubyrogues” to get $10 off your purchase
  • Twitter
  • Email: jason@angularonrails.com

2:20 – Angular or Rails?

4:40 – Real-time data modeling

9:00 – Angular CLI

11:15 – Structuring Angular and Rails apps

16:50 – Should beginners learn Angular or Rails first?

19:50 – Building apps and tying Angular and Rails together

25:00 – Angular on Rails feedback

28:00 – What’s the hardest part of integrating Angular and Rails?

31:00 – Why invest in Angular when it evolves so fast?

33:35 – Why did Jason write his book?

 

 

37:50 – How to get the most out of the book

42:40 – Panelist Jerome Hardaway

Picks:

Tour of Heroes Tutorial (Jerome)

General Assembly (Jerome)

DreamForce (Jerome)

Adventures in Angular Podcast (Charles and Jason)

Angular Remote Conf videos (Charles)

NgBook (Jason)

How to Win Friends and Influence People by Dale Carnegie (Jason)

The 7 Habits of Highly Successful People by Stephen Covey (Jason)

This episode is sponsored by

comments powered by Disqus

TRANSCRIPT

Charles:        Hey everybody and welcome to episode 282 of the Ruby Rogues podcast, this week on our panel we have a new Rogue, Jerome Hardaway.

Jerome:         Hi everybody, calling live from San Francisco with General Assembly and Dream Force. Really happy to be having this opportunity and be able to connect with the Rogues out there.

Charles:        Awesome. We also have a special guest this week and that’s Jason Swett.

Jason:           Hello.

Charles:        I think I forgot to introduce myself. I’m Charles Max Wood from Devchat.tv. This week we’re gonna be talking about Angular on Rails. Jason, do you wanna give us a brief introduction to yourself and then I will get started talking about Angular and Rails.

Jason:           Sure. My name is Jason Swett, I’m the author of the angularonrails.com, I’m historically a Rails’ developer, I’m teaching myself Angular over the last little while and as I’ve been teaching myself Angular, I’ve been teaching it to other people as well.

Charles:        Nice. I think Jerome you also mentioned that you’ve done some Angular.

Jerome:         Yes. I actually used Angular and Rails to teach better in style of code. I used to work a lot in using Angular and Rails for the past couple of years. That definitely is a great front end connector for your Rails app. I love it.

Charles:        Awesome. I’m curious, is your experience mostly with Angular 2.0 which has been out for I think three weeks now or is it Angular 1.0?

Jerome:         For me or the guest?

Charles:        For both of you.

Jerome:         Angular 1.0 for me, 1.0 or 1.5 I guess I could say, I haven’t really dived into Angular 2.0 yet. I don’t know Swett, is your tutorial, is that Angular 2.0 now?

Jason:           Yes. It’s Angular 2.0. Pretty much, all of my production and Angular experience is Angular 1.x. almost everything that I’m doing, going forward with angularinrails.com is Angular 2.0 because I figured, for the people who are just coming into it, they’re gonna mostly invest their time and to learn Angular 2.0. Angular 1.0 is definitely not going away at any time soon. I wanna have some kind of balance but of stuff I’ve been doing lately is Angular 2.0.

Charles:        Alright. I think we’re all familiar with Angular but let’s assume that or listener is familiar let’s say with Rails but not with Angular. Why would somebody want look in this something like Angular, why not just do things the Rails way.

Jason:           Good question. I actually think that, in a lot of cases, you should just use Rails and you don’t have to use front end framework like Angular in all cases. I’ll kinda describe the cases in which you might want to.

                    Over the last several years, the web has evolved and the expectations of web users have evolved. We’ve gone from having static websites to having richer and richer, more interactive web applications. Those web applications evolved more and more JavaScript.

                    As you do that, you have so many Ajax requests and so much front end logic and stuff like that and it’s very easy to let that run away from you and end up with a huge amount of Spaghetti code.

                    In my mind, one of the benefits of Angular is that it gives you places to put things and it gives you some structure for your front end portion of your application so that you don’t automatically end up with a mess. You can still end up with a mess even if you do use Angular but it gives you slots to put things. That’s one part of it and the other part of it is just it makes all this interactivity a lot easier than if you’re coding all the stuff from scratch.

Jerome:         Roger that. I was gonna actually piggyback on that. One of main reasons that I’ve been using Angular on Rails is for a more dynamic webplus. As you see, the interactivity on the web has like you said exploded and what was a novelty is now come the expected by the end user.

                    Live information, data modelling just come into front end and that’s one of my main reasons why I use Angular. I was a little intrigued on if you were ever going to expand on that Angular tutorials for users. Are you coming out with a book or anything in that regard?

Jason:           Well before I answer that, expanding which part exactly do you mean?

Jerome:         Expand on more the real time data modelling that you can do with Angular when it comes to information and actually having it show or search like a fuzzy search, things with that nature. Are you gonna be implementing more of that into your tutorials?

Jason:           Good question. That kind of stuff is more detailed than the stuff I’ve been covering so far. What I’ve been covering so far is just the super, most basic stuff like how do I even set up an Angular Rails app at all.

                    That’s actually really not a straightforward question and answer you know because there’s a number of different ways you can do it and a lot of different decisions you have to make.

                    When it was Angular 1.0 and I was building my first Angular in Rails app, this is like 2013 or 2014 that I was getting started with that combination. I was like, “Okay, how do I structure my Angular application? Where do I put stuff?”

                    I don’t think at that time we had what now was I think was thede facto standard, now I think it’s officially blessed as the standard that John Papa Angular Style Guide. That didn’t exist or at least I didn’t know about it back then. Everybody just kinda structured their Angular application, however their dev team decided to. There’s really no direction.

                    That was one thing and then it’s like, “Okay, do I structure this as like a client server architecture where Rails is just purely an API and then I have the client side like maybe even in a separate repo or do I put Angular in the asset pipe?” There’s so many decisions you have to make just before you even get to square one and you can have a hello world app.

                    That was one of the first things that I documented. I think what I ended up choosing was, and I don’t do it this way anymore, but what I used was Gulp with Yeoman. Yeoman was kind of the key component to the way I was spinning up my Angular 1.0 apps because they have a command that you could run and generate in Angular app.

                    It would give you a directory structure and to me that was great because a lot of people who comes from a Rails’ background have the philosophy of like, “I want the framework to be opinionated and to make most of the decisions for me. I want there to be one right way to do stuff even if I might not necessarily agree with the one right way to do stuff. At least everybody’s doing it the same way.”

                    One of the really nice things about Rails is that if you jumped into any Rails project, chances are that it’s gonna pretty much look like most of the Rails projects you’ve done in the past and you can locate things and be productive pretty quickly.

                    Anyway, I wrote a blog post back then about how to wire up Angular and Rails as a single page application. That was a pretty popular post. Looking back, I don’t know if I even agree with the stuff I wrote but at least it was a way to get started. You could skip over scratching your head and making all those decisions and thinking about that stuff. It was just totally paint by numbers.

Jerome:         We have to share some notes. I’ve been using Bower. I really like Bower for my CLI and just being in a great thing. After the show, I would love to take some notes on that at a later day.

Jason:           Absolutely. You mentioned CLI stuff, with Angular 2.0, we have the Angular CLI. Have you guys used that much at all yet?

Charles:        Yup.

Jerome:         Maybe. I haven’t played with it at all right now. I’ve been so focused on just using the Rails component lately for our students. I haven’t really played with that yet but I have plan in getting into it in the next couple of weeks. Looking forward to it.

Charles:        If you like the Rails CLI, you know the Rails command line interface, then you’ll like the Angular CLI. There’s a lot that’s very similar there.

Speaking about setting up Angular on Rails, I’ve seen people trying and make it work with sprockets and the asset pipeline in Rails. I’ve seen people pull in just in other ways, pull in Angular and make it work that ways so they kind of set up their own little client project area then they’ll use something like web pack or the CLI actually pulls in web pack for Angular 2.0 or do something like Bower or some other build process with Gulp or Grunt and just make that works. There are a lot of ways to go.

Jason:           Yeah. That’s the tough thing is that there’s so many different ways you can do it. I’m really glad that for Angular 2.0 the Angular CLI exists because again it would not be ideal if everybody who’s doing Angular is structuring their project in a different way and every time you come and do Angular project, even though it’s still Angular, you have to get familiar with that unique directory structure and build system and all that stuff.

                    I like the fact that if you’re using Angular CLI, you’re gonna get the directory structure that Angular CLI gives you. It’s gonna be using web pack. I’ve been betting pretty hard that in the future, Angular CLI is gonna become a really essential part of the workflow for most people’s Angular 2.0 development. For all my Angular 2.0 educational stuff, Angular CLI is a part of that.

Charles:        One thing that I’m wondering then is if you’re using Angular CLI, it kinda comes with its own build process with web pack. Do you let it essentially build your typescript Angular app into whatever JavaScript file it’s gonna build and then hand that off to the asset pipeline or do you just include it separately?

Jason:           Here’s how my dev process goes, and let me back up just a little bit before I answer that Chuck, and describe how I structure my Angular Rails apps. When I’m building applications, I’m kind of making an assumption abutt audience that they wanna build single page applications because I kinda have to pick one style and go with that because I just can’t cover all the different permutations that are possible. It’s just too much documentation for me to write.

                    I’m assuming you wanna build a single page application. The way I handle that in development is I spin up a Rails Five API on the application, have that going on LocalHost 3000 and then separately, I spin up an Angular CLI project, I run  the NG serve command to let Angular CLI spin up in Angular server. That runs on LocalHost 4200 and then I proxy any API requests locally to LocalHost 3000.

                    I have the Rails server and Angular server running separately locally. Then when I deploy, I have Angular CLI do a build into the public folder for Rails and then I just run that all in the same place. I don’t know if that answers your question, Chuck.

Charles:        That sure does.

Jerome:         What I’ve been doing is that I’ve been using a combination of Bower and Sprockets. Instead of having a run of 4200 and a local 3000 of host 3000, I’ve been integrating them both and having them run in unison on local host.

                    One of the things that I wanted to ask is why would you go through that process of having it run in separate components instead of focusing on getting it to integrate as smoothly as possible so all you have to do is that Rails S and then turn it and then have it run. I ask how we treat our troops so I just want to understand the why behind your method.

Jason:           Sure. It sounds that the way you’re doing it is, are you putting it in the asset pipeline?

Jerome:         Yes. We have put it in within the asset pipeline and also Bower files.

Jason:           Yeah. That’s a totally fine way to do it. I haven’t really gone down that path myself because I’m going kind of the totally separate client server architecture. Some people like that because when you’re deciding how to structure your application, it depends a little bit on your team’s structure. Like do you have dedicated backend and frontend people?

                    Or if your team is like all full stack or mostly full stack people, you have everybody who’s comfortable doing both Rails stuff and Angular stuff because some people are gonna go so far as they have the backend and the frontend be separate repos.

                    That’s just kinda the way I chose to do it. It’s not necessarily better or worse in any other way. Just again, I had to pick a way and kind of go with that for all my material.

Charles:        I’ll just pile onto this. I like the way that Jason approaches this just from the standpoint of I’d never really had a lot of luck in typescript to work really nicely with the asset pipeline. It may have been something I was doing wrong but I’m a fan of typescript. I kinda had to be one over but I had it explained, I tried it out. There are lot of things that we really like.

                    In order to get typescript with Angular 2.0 to run nicely, I find that the tools that come with Angular in Angular CLI are a lot nicer. If I can just make that build, build, build, run, run, run I don’t might running two different servers to make it work. Though I didn’t get the proxy working but that’s a separate issue that I’ll talk to Jason afterward. A little of trouble with proxy and over the whole LocalHost 3000 so I just hard pounded the URL into my components and made it work that way.

Jason:           Jerome, are you using typescript in the asset pipeline or are you using some other flavor of the ECMAScript?

Jerome:         We’re using JavaScript and ES6, that’s what we’re using. We’re not using typescript for the purpose of the troops. We don’t wanna try to introduce them to too much heavy stuff too soon.

Jason:           That’s another thing I wanted to say like. On angularonrails.com, I have an email subscription list where people can stay updated. A lot of the people who sign up, when they do sign up, they get an email from me automatically saying like, “Hey, what’s your background? Why do you wanna learn Angular, blah, blah, blah?”

                    A lot of the people who sign up are brand new to development in general. If you’re brand new, I probably wouldn’t recommend that you try to start with an Angular, Rails, single page application write on day one. I imagine user probably don’t do it that way.

                    My recommendation to people is usually like learn Rails first and then once you get a little comfortable with that, then you can start learning the Angular stuff too. Out of those two, I would probably start with Rails. It seems easier to pick up in my mind.

Jerome:         Yes. It is. Actually, I’ve made that mistake in trying to jump straight to Angular and Rails then we had retrograde back into just full stack Rails. I just wanted to know because it was more educational purpose that you have this set up that way so that you understand more of the components of building Angular app and Rails app because most times, what I’m seeing is that when I’m talking to people in the community, they’re messing with Angular, they usually mess with it and conjunction with something else like MEAN stack or LAMP stack or Rails.

                    One friend of mine used to say, “Angular work for us.” They’re not really just using Angular stand alone. I just wanna know, maybe if it was for something so they can get it dive deeper into Angular itself or into something like that.

Jason:           There is one really good reason I think for having them separate like that. Pretty much all the Angular and Rails projects that I’ve inherited from other people have Angular in the asset pipeline. Pretty much all of them have abused Angular horribly for a number of reasons. One thing that I see is in the templates, they have tons of ERB and Angular string interpolation mixed together. Especially when the templating language is Haml. There’s a lot of braces in it. Angular templating, there’s a lot of braces in it. When you have all that stuff mixed together, it’s like hang on what, what here is Ruby and what’s Angular, what’s coming from Rails and what’s coming from Angular? When you throw a bunch of Twitter bootstrap classes and stuff on there, it just becomes indecipherable.

If you separate the Angular code into a completely different directory and you make it physically impossible to mix Ruby and JavaScript, then you can’t shoot yourself in the foot that way. That’s probably the best reason I have for doing it that way but again, I didn’t put a ton of5 thought into how I’m gonna structure this before I built it, I just kinda randomly picked a way and went with it.

Charles:        Let’s go ahead and talk the structure of Angular for a minute because, again, I know some of our listeners are familiar with Angular, they’re using it with Rails or Sinatra or what have you but how are people putting their Angular apps together?

                    They’ll go look at the documentation C stuff like components and views or templates and services and directives and all of these other things in the routing.  How do people think about that with relation to their Rails app and how do you actually tie those two together?

Jason:           Good question. Just a quick PSA I guess, I wish I didn’t have to say this but one way not to deal with it is to just throw everything in Angular controllers because that’s why I see so much. I’m talking to Angular 1.0. People will just put all of the code and controllers and it’s absolute insanity, don’t do that.

                    More about Angular 2.0, the way that is structured, the building block of Angular 2.0 is something called components. They’re kind of shifting Angular 1.0 to be this way too. In Angular 1.5, they introduced components and my guess is that they’re doing that in an effort to push Angular 1.0 more into the shape that Angular 2.0 is so if and when you upgrade from Angular 1.0 to Angular 2.0, it’s as smooth as possible.

                    Basically, if I can explain this in terms that aren’t too technical because Angular has a lot of terms and concepts and I’d think that kinda works against the objective of learning. In the Angular 2.0 component, the way I think about it is if you’re creating your own custom HTML tag so you can put that HTML tag on the page and with that, you automatically get a template with some behavior to it, that’s kinda how I think of that.

Charles:        Yeah. Another way to put it is you’re saying you create your own tag. For example, you created a tag that, they have an example that’s Tour of Heroes. They essentially have a hero tag. What that does is then the components know to replace that with standard HTML that gets added to the DOM that renders a profile view for a hero.

                    The rest of the component is the logic. I tend to think of it as the template, the V model. If you’re familiar with MV*, this is kind of an MVVM. The M part of it is usually a service that connects back to the API. The V is the template which can embedded in the component or can just be a separate file that’s referenced by the component and then you have the rest are logic that goes in it as a V model.

                    You can nest components. You can have a hero and then you can have a hero image component that creates a hero image tag that just puts in the image into the right way and gives it behavior and on and on and down and down.

Jason:           Yup. If you hear this stuff and wondering the heck we’re talking about. That Tour of Heroes tutorials on the Angular site, I found it pretty good as far as dipping your toe under the water with Angular 2.0. It takes you through the steps of creating something and getting it working. When I looked at that for the first time I was like, “Oh yeah. Okay, this is kinda how it works.”

                    By the way, little self-plug here. If you go through the Tour of Heroes tutorial, I have a blog post that shows you how to take that Tour of Heroes tutorial in Angular and then put Rails app underneath that and get the two talk to each other. That can be one easy way to get started.

Jerome:         I’m gonna share that.

Charles:        Yeah. It’s pretty nice. I actually went through that and it was working pretty well as far as I got on it, before I was like, “You know I wanna build my own thing.”

This episode is sponsored by hired.com. Every week on Hired, they run an auction where over a thousand tech companies in San Francisco, New York and LA bid on Ruby developers providing them the salary and equity up front.

                    The average Ruby developer gets an average of 5 to 15 introductory offers and an average salary offer of a $130,000 a year. Users can either accept an offer and go right into interviewing with the company or deny them without any continuing obligations.

                    It’s totally free for users and when you’re hired, they also give a $2,000 signing bonus as a thank you for using them but if you use the Ruby Rogues link, you’ll get a $4,000 bonus instead.

                    Finally, if you’re not looking for a job but know someone who is, you can refer them to Hired and get a $1,337 bonus if they accept the job. Go sign up  at hired.com/rubyroguespodcast.

Jerome:         One question I have that has nothing to do with programming as for sale when it comes to the Angular and Rails is, I signed up two months ago for Angular Rails project. One of the things that like I absolutely was excited to see a blog out there for that, for some type of like or people that might be interested, they’re already in development, things of that nature. The tutorial was sending me my email at one part and then I would wait for three days or a week or something for another part.

                    It drove me crazy and like on a humorous though, “Why did you do that?  It was torture.” I was like, I can’t do this because I’m going into banging my head against the wall while I’m waiting for it. I just want the whole, you give me the whole tutorial. I’m like I’m ready to go and you give me a little bit and stop, like who does that, that’s some type of masochism right there.

Jason:           That’s really funny. That’s really interesting that you asked that because I changed that just a few days ago. I call it an email mini course. So now instead of the email mini course, what you get is a guide that I created that’s just everything at once.

                    Just a real quick explanation of why that was the way it was, I was kinda falling via the paint by numbers build a business online approach. People are telling me, “Hey, you should create an email mini course that teaches people your thing.” And so I was like, “Okay, I’ll create an email mini course.” I had it out there for a while and then I realized, “Oh wait, that’s stupid.” Then I changed it to be not stupid anymore.

Jerome:         Awesome. I was like I said, I was so excited when I saw it and then I tried it and I was like, “I’m gonna go crazy waiting for these emails. I’m too busy. I can’t do this.” I actually told my students who brought up that you changed it. I just wanna let everybody else to know. You can get the whole thing out there now, it’s amazing.

                    I thought it was a really good resource especially for people who have some technical experience that really want to dive into a framework, especially with with your concept of connecting Angular 2.0 on Rails. Right now it’s really big in the community that connect to JavaScript framework to a Rails app. You still have that, I guess, you can still be like the cool kids but still use Rails and Ruby at the same time. I’m really excited of that change.

Jason:           Yeah. By the way, a feedback like that is super helpful. If anybody listening to this happens to go to angularonrails.com and gets that guide, just please hit reply and tell me what you think of it. Like if you find any mistakes or you think it could have been better somehow, please let me know.

Charles: I’m curious, I’m asking this to both of you. What do you think is the hardest part of integrating Angular with Rails?

Jerome: For me, when it comes to integrating Angular with Rails, I think the initial connection is difficult. Getting the tempting to speak to the Rails app, or to working units in the Rails app. That’s from my point of view, from my experience, the first initial step to always the hardest and the ones that makes or breaks the app literally. You change it from having a real smooth building process to having to start all over.

For my experience, it’s been those initial using Bower G Install and then getting the Bower file to connect to Angular. Adding into the asset pipeline, because for our students we don’t use typescript, ensuring that instead of typescript it uses JavaScript. Just going from that. Those are the steps we go through, and those first initial steps have always been the trouble spots that everybody should pay attention and take notes of, things of that nature.

I’m interested to hear what Swett has to say to that.

Jason: For me, it’s three things. Deployment, testing, and with Angular 2.0 just the pace of change with the technology. Especially for this is a little bit unique to my personal situation, but I’m documenting this stuff. It’s almost like you know the Golden Gate Bridge every time they get done painting it, they just start back over at the beginning and start painting it again? I have to do that with all my stuff because Angular 2.0 is constantly changing.

When I first released my book, it was outdated on launch day. It was physically impossible for me to keep it up to date enough. Now that Angular 2.0 final is out, that has stabilized a little bit. For me, that just would drive me nuts when I would document something and then the day I got done with it it didn’t work anymore because they changed it.

Those three things. But like I said at this point in time, I think that pace of change is slowing down a little bit. The rapid pace of change in the JavaScript world in general, that is probably not going to slow down anytime.

Jerome: That was going to be my next question, why would you invest so heavily in integration of Rails with an application within JavaScript framework that is so radically changed? There’s a very funny article out right now, it shows how JavaScript frameworks are popping out basically every 15 minutes. It’s almost like Krispy Kreme donuts, get it while it’s hot. It’s saying that that’s the rate that these frameworks are coming out.

I was wondering, especially when they’re changing it with the Rails core team, they keep a lot of the things that we are accustomed to trying to make them better. As you said before, Angular 1.0 almost feels totally different from Angular 1X. As you said, you wrote your Angular your book and it was outdated the minute it launched. Why would you invest on that part of the product when it comes to something that changes literally so fast? You’ll wake up next week and Angular 3.0 would be in the makes. I just want to have some feedback on that. I think that’s some really interesting light, that passion it will take to take on a project of this magnitude, basically you’re putting out flyers all the time.

Jason: There’s two parts of answering that question. One is in general why would a person build a production application that he uses a front end technology that moves so quickly. My answer to that would be if you’re going to build any new project, think about it before you choose the frontend technologies. If you sit down with your team and talk about it and you decide that what you need is an application that has deep, rich, interactive functionality and it’s going to be a nightmare unless you use the tool like Angular, then that’s a good reason to use Angular.

Using Angular because you think it sounds cool and you just want to try it out for it’s pretty standard application, that’s probably not a very good reason to use Angular. I would ask myself when building a new application, can I get away with just plain old Rails? If you can, then just use Rails. It’s okay to build a regular, old fashioned web application that doesn’t use a frontend framework.

For me, to answer the other part of that question, Jerome, why would I choose to take on this endeavor of documenting the stuff and teaching it to people? I’m talking to the people who have already made the decision that they want to build a single page application using Angular. And you know, I have to go back and re-update stuff constantly but that’s just kind of my life.

A big reason that I built this at all is because there was nothing like this that existed. If you Google Angular and Rails, I Googled that back when I first started this in 2013 or 2014, I was shocked by how little existed. There was this book called NG Book, it still exists, there’s a version two of it now by Ari Lerner. He had an additional little ebook that covered Angular and Rails. It was pretty good but it was just very short. It didn’t cover everything that I wanted. I was just like man, I cannot believe how little out there exists that covers Angular and Rails.

Jerome: Pragmatic Bookshelf now, they have a full book on Angular and Rails and Postgres and bootstrap as well. I’ve just recently heard about it and picked it up. I’ve looked at it and between your product and their product, I definitely say your product is far more user friendly. It’s just one of those things that I just want to understand. You’re right, there’s not enough Angular and Rails information out there, or Rails and any JavaScript framework. I was interested in it because that stuff, JavaScript frameworks change like I said every 15 minutes. They’re like the weather in my experience.

Jason: People that ask me if I’m going to put out a print version of the book, I was like yeah maybe I’ll do that. At this point, it’s like I don’t think I want to because the second it gets printed, it will be outdated.

Jerome: That would be a waste of money,  bad investment. Keep doing what you’re doing.

Jason: One good thing from the consumer when we buy an ebook and it gets updated, as long as the author chooses to, they can push out updates so you can always have the most updated thing and I like that.

Charles: Yes, it’s interesting just from the standpoint of, I mean when I’m looking for something like this where you and I understand Rails and this is written for Rails developers. I understand Angular 2.0, I’m not an expert in Angular but I’m passable at Angular. I want something that’s just going to walk me through the essentials but I want something that’s going to walk me through the essentials in a complete way so that I don’t have to guess which leaps I have to take.

That was something I really did like about your book was that I could skim through it, find the places that I didn’t know, and then just plug all that stuff in. It was pretty apparent where you were going with what some of the next steps were going to be. It was easy to follow, it was nice just to plug in a lot of these pieces so that they just worked.

I also have to thank you for pointing out rack, course, gem. I’ve built apps with Angular 1.0 and Rails and I was using Angular 1.0 basically cross origin and setting up course was such a pain. Oh yeah, just allow anything, just allow these domains, it was really, really nice.

Jerome: Yeah, I think it used to be a lot more painful than it is now. When you spin up a new Rails Five application now, there’s a commented line in the gem file that has the rack cors gem in it. I don’t think that was always there, I think that’s latest edition.

Charles: Yeah, the other tidbit that I picked out of the book was the —api. You do the Rails generate on scaffold or controller, it doesn’t generate all of those HTML views which is also very handy.

Jason: Yeah, I like that a lot too.

Charles: There are a lot of other just little tidbits like that, just getting set up that I really like.

Jerome: This is for the newbies. How would you recommend for a person who has some experience with Rails, I’m thinking maybe less than a year, they saw your book and they want to try it. What would you give them as the best advice on how to get the most out of your book?

Jason: Whenever I’m teaching myself a new technology, I do it in kind of two passes. On the first pass, I do a spike so people might be familiar with the term. A spike in general is just when you build some feature quickly and you don’t worry about good code or test coverage or anything like that, you’re just exploring to see how feasible it is. That’s what I do first.

When I first built an Angular app, I definitely didn’t want to try to build a production application as my first Angular application because I don’t know about other people but for me the first time I use any technology, I do it totally wrong. That was true of Rails too, my first Rails app was horrible. My first Angular app was too. If that’s the case, let’s just constantly acknowledge that.

For my first project using anything, I don’t want it to be something that matters. I would recommend you do that first, just go through and build something. Just get to a point where it works as quickly as you can. For one just so you can kind of see what’s what, but two just for motivational purposes. It’s really discouraging if you try to build something and every two seconds it’s like oh, I can’t move to the next step because I’m getting this weird error I don’t understand or whatever. If you try to get every little thing perfect, then you’re just never going to get there.

I like to do a spike first, and then once I do that, that gives me a high level overview of the landscape and I can use that now deeper understanding that I have to go back. And then the second time, I’ll pay more attention to good code and test coverage and all that kind of stuff.

To answer your question Jerome, right now I’m reworking my material to reflect that. The book is basically one big, long tutorial which is fine but the thing that I don’t like about it is it tries to make it too perfect the first time through. When you’re building stuff, it’s like oh okay, you generated this new component but that broke our test so let’s go back and fix our tests. What I’m adding to it is in the beginning I’m going to add a spike.

But right now if you download my guide to getting started with Angular and Rails, that does a spike for you. If you want to still get that same thing, you can go to my guide and do a spike. Then, you can go to the book which doesn’t do a spike, it goes through the more really in depth cover every little thing and that kind of thing. That’s the approach that I’d recommend.

Jerome: Awesome, thank you.

Charles: I want to give you a minute to just talk about what you have on angularonrails.com before we get to picks. If people want to follow up with you, follow you on Twitter, go buy your Angular On Rails book, anything like that, what do they do, where do they go?

Jason: You can pretty much get to everything by going to angularonrails.com. Like I said, there’s the free guide to getting started with Angular and Rails. It’s like the front page is that if you put it in your email, it sends it to you. It won’t drip it out over several days anymore Jerome, it will give it to you all at once. If you want to buy the book, you can use the code “rubyrogues” and that will get you $10 off of any product on the site. You can email me at jason@angularonrails.com if you have any questions about Angular, using Angular on Rails together. I really enjoy hearing from people and answering questions and stuff like that. On Twitter I’m just @JasonSwett.

Jerome: Already followed you, man.

Charles: Nice. Now Jerome, you’re doing something a little bit different this week so I wanted to give you a minute to talk about Vets Who Code and Dream Force real quick.

Jerome: First and foremost, thank you Charles. I’m out here in San Francisco and we’ve been invited to Dream Force to meet, mingle, and do some meetings with some really amazing people and tell them about our mission when it comes to helping veterans learn how to code. You guys who didn’t hear me on Ruby Rogues before, I became a panelist. What I do is I help veterans learn how to do software development in Ruby on Rails and Angular. That’s why I was so excited when I found Jason Swett’s material and I was like driving me crazy, I want to do all this at once.

It’s a really amazing opportunity. We’re out here, we’re going to meet and mingle with Vet Force and do some amazing things that will hopefully help more veterans transition into the technology sector which you guys know is like my main mission. I’m out here ready to have a blast and pass out some cards.

Charles: Alright, cool. Let’s go ahead and get to some picks. Jerome, since you were just talking, go ahead and share some picks with us.

Jerome: First pick is definitely going to be that Heroes Angular 2.0 tutorial. Just off the cuff, I absolutely love the idea of something like that that can help people. That’s pick number one.

Second pick, for our number one pick is General Assembly. That’s another great pick. These guys, every GA City lets me come in and just use as a workspace, workplace, they’ve been one of our number one supporters as a 501(c)(3).

The third pick would be Dream Force for asking us to come out here and meet and mingle with these beautiful people, preach the gospel and help the veterans. Those are my three picks for this week.

Charles: Very cool. I’m going to jump in with a couple of picks. The first two are somewhat self serving but I’m going to put them out there.

The first one is Adventures in Angular. If you are into Angular or you want to get into Angular, I put on another podcast with another panel and we talk about Angular every week. Over the last few months, we’ve been talking a lot about Angular 2.0. If you want to get familiar with some of the concepts that are in Angular 2.0, we cover them basically as they were released.

Some of the panelists include the developer relations team lead or I’m not sure exactly. She’s the lead there, she’s on our show. The contractor that they have writing all their documentation, he’s on our show. Jason mentioned John Papa who wrote the Cell Guide and Poor Heroes, he’s also on the show every week. We kind of have an all-star panel where we talk about Angular.

If you want videos from an Angular conference, Angular Remote Conf videos are up. You can get them for $100 a piece. By the time this goes live, Rails Remote Conf will be over but you can also get those videos for the same deal. The tickets are typically $200 a piece, but $100 gets you unlimited access to the videos afterward. Since you don’t have the live experience of the Slack chat or anything else that comes with those conferences, it’s a surprise.

Anyway, those are my picks. Jason, what are your picks?

Jason: My first pick, Chuck, was actually going to be Adventures in Angular. I just want to make a comment about that show. You might think that I don’t want to learn about technical stuff from audio but I’ve actually found it hugely helpful in a way that no other source is because it’s just so timely. What I’ll do is I’ll listen to those episodes and then go Google the thing that the episode is about.

The guests that are on the show, just another tip, pay attention to who the guests are and then go Google the names of the guests. They’ll usually have books out there, or videos, or some other resource. By subscribing to Adventures in Angular, it helps you get plugged into all these other resources too.

Another pick of mine is NG Book which I mentioned earlier. I’ve only read the Angular 1.0 version of NG Book but it was really in depth and really good so I’m sure NG Book 2.0 is good too, I just haven’t gotten to that one myself yet.

I actually have a couple non-technical books that I want to share just because these books have totally been life changing for me and it reaches into all areas. Those two books are How To Win Friends And Influence People by Dale Carnegie, and then the other one is The Seven Habits of Highly Effective People by Stephen Covey. Those are my picks.

Charles: Very cool.

Jerome: Awesome. Two books that I really need to get to reading.

Charles: Absolutely. Stephen Covey actually used to live over here. I got to meet him once.

Jerome: Oh wow, that’s awesome.

Charles: Both of those books are really tremendous books. Anyway, we’ll go ahead and wrap up the show. Go check out angularonrails.com and we’ll catch you all next week.

Jerome: See you guys later.

Jason: Bye guys, thanks.

 

x