Building my first site, after doing three tutorials. How should I frame out the scaffolds?

I am building a site that will allow landlords to list office spaces and tenants to rent office spaces. Each office space will be a part of a building. And a landlord can have either many properties and/or many office spaces. Each property will have review(s) by past tenants. Right now I have the following models: property.rb spaces.rb user.rb And I have the app in development here: I know this is super broad, but how should I go about getting the major components working? I'm especially interested in thinking about first steps to really wrap my head around the structure of the relationships that are necessary. Any help would be great on this + will promise to share as I continue to build. Thanks!

Posted almost 5 years ago by Zak
Posted almost 5 years ago by Alex Yang

Zak, congrats on starting to build your first site! Transitioning from following tutorials to writing your own code is both the most challenging and rewarding part of learning to code. I'm happy to help you get your bearings as you start planning out the structure and design of your site.

When starting a new app, I recommend starting by thinking through what databases you'll need and what associations you'll use to connect them together. It sounds like you've already started doing that which is great. In particular, think through each pairing (e.g. Property<->Space, Property<->User, Space<->User) and identify whether it's a belongs_to/has_many association, belongs_to/has_one association, etc. Here's a link to a great resource for reading more about associations:

Once you've mapped these out, start adding them to your app one at a time. For example, if your site will need the full functionality for Properties (e.g. add, edit, delete, etc), then start by generating a Property scaffold. If you only need a subset of those features or the database portion only, you could generate just the controller or simply create a migration alone. Once you've created the pieces you need for Properties, layer on Spaces, and then Users, making sure in each step to create the right database associations, customize your view pages, add the necessary links to your navbar, etc. Take it one step at a time and test along the way so it'll be easier to catch and debug mistakes as they happen. Hope this is helpful and keep me updated on how it goes!

Posted almost 5 years ago by Zak

Alex- this is super helpful. Really appreciate it. Although I've started to build that app, I think I'm going to do the etsy tutorial today/tomorrow. As a side note, I really really appreciate you having multiple tutorials that are basically at the same level for the same thing. Going through something several times really helps to start making things a little less intimidating.

I first started with one month rails, and finished their pinteresting app-which was great. But there was no where else to go after that. And just diving into rails casts seemed a step too far. That's when I found baserails and was excited to see several apps with the same language. So kudos to you.

After going through the YelpReviews app and the pinteresting, here are the things that are clear:
1) bootstrap
2) git
3) deploying on heroku
4) scaffold
5) devise / and basic customization ala bootstrap
6) creating ruby links / raking routes

Things that are less clear
1) Knowing what to write in a rails console--so knowing ruby (I guess)
2) Figuring out the logic of the controller(s)
3) Figuring out how to add things to things that are already created--yes, db migrations

Anyways those are just some. I don't mean to ask you to answer them here. I thought it might just be useful for you to know as you keep thinking about future tutorials and future ways to present material.

Again, thanks for all your hard work and I'll keep you posted on my progress!

Posted almost 5 years ago by Alex Yang

Appreciate the feedback - I'm glad that you've found the courses helpful! I've heard from other BaseRails students that by going through the same course more than once, they've been able to absorb a ton more the second time. Might be something worth trying. Also, I'm happy to answer any questions you have on the 'less clear' points - just let me know.