Generic-user-small Dan Steinicke 3 posts

I enjoyed watching your first episode, and learned a few things from watching it, but was somewhat confused by how I am supposed to follow along.

In the video you use the generate script to create the models, so I figured if I wanted to follow along I should create a new rails app in the terminal and do the generates with you. This works fine until the part where you start using script/console. When I try to do this no data has yet been added so the console commands don’t work because there are no movies or theaters in the database.

If instead of creating a new rails app I use the downloadable files the console commands work, but the generate script doesn’t because all the files are already there and the model files already have associations in them.

Is there a way I could have set the files up to be able to follow along with the video? Am I missing some instructions on how you are supposed to set things up so you can follow along with the video?

 
Ryan_bates_cropped_small Ryan Bates 25 posts

Hi Dan,

If you downloaded the provided source code, you can load some initial data from the fixtures with this rake command.


rake db:fixtures:load

Sorry I didn’t mention this on the video. It isn’t intended to be a complete walk-through, follow along tutorial. This is because Rails applications can get very complex and to show how to set up everything from scratch can take away from the topic at hand. But that’s no excuse for not creating some initial content in the database since that applied to the current topic.

Thanks for your feedback.

2 posts, 2 voices