15 Aug 2008, 18:25
Generic-user-small

Dan Steinicke (6 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?

15 Aug 2008, 19:04
Ryan_bates_cropped_pragsmall

Ryan Bates (60 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.

04 Feb 2011, 02:52
Generic-user-small

pravinrao (1 post)

Hi Dan -

I’m definitely a novice at Ubuntu, Ruby, and Rails. I am a physician trying to learn active record to learn to make inquiries into a medical record system made by my boss (an engineer and physician).

Your videos (especially the first two) were very helpful for this and made me feel like I was really understanding how I might make queries into the data.

My question relates to the question above…

When I make new rails projects and cd into the folder and type “rails s” it starts the server. However, when I cd into the folder with the source code, I can’t run the rails server. Instead it just gives a list of possible commands to use.

Is there something I’m missing? Is it possible to run the code on the rails server? How can I use the source code to practice the methods that you teach in the video?

Thanks a lot - Pravin

  You must be logged in to comment