1 00:00:00,000 --> 00:00:06,000 [Master Class] [Designer and Developer Workflow] [Generating the Project] 2 00:00:06,000 --> 00:00:08,000 So, I just got done with my planning meeting with Nick, 3 00:00:08,000 --> 00:00:11,000 and he's going to start working on some wire frames, but what I want to do 4 00:00:11,000 --> 00:00:13,000 is get him some real code as soon as possible. 5 00:00:13,000 --> 00:00:15,000 So, what I'm going to do is set up a get repository 6 00:00:15,000 --> 00:00:18,000 so we can share code between each other. 7 00:00:18,000 --> 00:00:21,000 And then I want to actually create the Rails application and generate the jobs model 8 00:00:21,000 --> 00:00:24,000 and views so he can start working on them. 9 00:00:24,000 --> 00:00:26,000 So, let's get to it. 10 00:00:26,000 --> 00:00:30,000 What I need to do is figure out right now what I need to do and in what order, 11 00:00:30,000 --> 00:00:34,000 because right now, Nick is in the process of beginning his design work in parallel. 12 00:00:34,000 --> 00:00:39,000 So, there are some things that I need to get done soon so Nick can begin doing his work. 13 00:00:39,000 --> 00:00:43,000 Namely, I know that Nick likes to design in actual views in the page. 14 00:00:43,000 --> 00:00:46,000 He doesn't really spend a whole lot of time working in Photoshop 15 00:00:46,000 --> 00:00:50,000 and really works on creating his own HTML as he goes. 16 00:00:50,000 --> 00:00:55,000 Now, he can do that in his own HTML files, but really it's going to be a lot better 17 00:00:55,000 --> 00:01:00,000 if he has a Rails scaffold to work on so he can just work directly in the views. 18 00:01:00,000 --> 00:01:06,000 So really, my priority here is to get the project set up and to be able to get him the project 19 00:01:06,000 --> 00:01:09,000 with some views that he can begin working on. 20 00:01:09,000 --> 00:01:14,000 So, our first course of action is going to be to generate the Rails project. 21 00:01:14,000 --> 00:01:18,000 After that, we need to set up Git. 22 00:01:18,000 --> 00:01:21,000 Now, I'm going to be using GitHub to store our repository, 23 00:01:21,000 --> 00:01:25,000 and then Nick can push and pull from GitHub, and I can push and pull from GitHub, 24 00:01:25,000 --> 00:01:28,000 and that's how we'll keep our code in sync. 25 00:01:28,000 --> 00:01:32,000 So, I need to go to GitHub and set up a new project and get it set up so we can 26 00:01:32,000 --> 00:01:36,000 push into that project, and then I'll be sending Nick the details so he can get set up 27 00:01:36,000 --> 00:01:40,000 and pull on the project as soon as possible. 28 00:01:40,000 --> 00:01:48,000 Then I want to go ahead and generate a scaffold for our jobs. 29 00:01:48,000 --> 00:01:51,000 And we decided in this iteration we really just want to be able to post jobs 30 00:01:51,000 --> 00:01:54,000 and be able to view them from the client side. 31 00:01:54,000 --> 00:01:58,000 So basically, for Nick to be able to do his job, he just needs to be able to have 32 00:01:58,000 --> 00:02:02,000 the index view and the show view for the job, and then an interface 33 00:02:02,000 --> 00:02:06,000 so he can set up test data in his local account. 34 00:02:06,000 --> 00:02:10,000 So, the first thing we want to do is, let's go ahead and just generate a new Rails project. 35 00:02:10,000 --> 00:02:13,000 But first, we need to make sure we have Rails installed. 36 00:02:13,000 --> 00:02:17,000 So, what I'm going to do first is install Rails. 37 00:02:17,000 --> 00:02:20,000 So, we'll just do sudo gem install rails. 38 00:02:20,000 --> 00:02:26,000 This will take a little while to install Rails, so we'll just skip ahead. 39 00:02:31,000 --> 00:02:33,000 And we're done. 40 00:02:33,000 --> 00:02:39,000 So, I'm in my projects directory, and let's go ahead and generate our Rails project. 41 00:02:39,000 --> 00:02:41,000 So, let's take a look at the options that we can do for Rails 42 00:02:41,000 --> 00:02:50,000 and see if we want to specify any of them when we generate it. 43 00:02:50,000 --> 00:02:55,000 So basically, our options here are to work with what database we want to use, 44 00:02:55,000 --> 00:02:59,000 and I think ultimately, we're probably going to deploy onto Postgres, 45 00:02:59,000 --> 00:03:03,000 but for our development purposes, I'm going to work with the default SQLite3, 46 00:03:03,000 --> 00:03:06,000 and this is because it's just really easy to set up. 47 00:03:06,000 --> 00:03:09,000 It's just a local file, and it's going to work for us. 48 00:03:09,000 --> 00:03:13,000 We shouldn't need to do anything advanced that would require us to really 49 00:03:13,000 --> 00:03:17,000 step out of the database agnostic part of active record, 50 00:03:17,000 --> 00:03:20,000 so we can use really any database that we want. 51 00:03:20,000 --> 00:03:25,000 So, the other thing we are probably going to go ahead and skip are the prototype files, 52 00:03:25,000 --> 00:03:28,000 and these are the JavaScript files right now included by default with Rails. 53 00:03:28,000 --> 00:03:33,000 We're going to be using jQuery, and jQuery in Rails 3.1 would be the default, 54 00:03:33,000 --> 00:03:37,000 but right now, prototype is the default, so let's go ahead and skip those, 55 00:03:37,000 --> 00:03:41,000 and we'll be adding in the jQuery parts momentarily. 56 00:03:41,000 --> 00:03:45,000 So basically, to create a new Rails project, we're going to type in 57 00:03:45,000 --> 00:03:49,000 "rails new" to generate the project, and let's give it a name. 58 00:03:49,000 --> 00:03:56,000 We'll call it "easyjobs," and we'll pass in "- J" to skip the prototype files. 59 00:03:56,000 --> 00:03:59,000 So, let's see what happens when we do that. 60 00:03:59,000 --> 00:04:02,000 So, it's gone ahead and created everything, and if we look at our files, 61 00:04:02,000 --> 00:04:08,000 we'll see there's an easy jobs directory, so let's just jump into that. 62 00:04:08,000 --> 00:04:12,000 So, if I clear this out and we take a look inside, we have a Rails project. 63 00:04:12,000 --> 00:04:18,000 Now, I'm going to go ahead and open up the Rails project in my text editor TextMate. 64 00:04:18,000 --> 00:04:22,000 Now, here we have our Rails project set up and ready for us to use, 65 00:04:22,000 --> 00:04:24,000 and it looks pretty good. 66 00:04:24,000 --> 00:04:28,000 We can look into our public directory inside JavaScripts, 67 00:04:28,000 --> 00:04:31,000 and we can see that the prototype files are not there. 68 00:04:31,000 --> 00:04:36,000 We just have a basic application.js, and we'll be setting up our defaults later.