This is the sample code from Lab #2. Hopefully you had a chance to work on this in class and have your own version. If not, feel free to download this and use it as a starting point for Lab #3.
- Generating a new resource
- ActiveRecord relations
- Creating a form for a nested resource
- Building a create action in a new controller
- Rails 3.1.1
- ruby 1.9.2
- see Gemfile for more information
- download the code https://github.com/kudelabs/roc-lab2 either with git or as a zip file
$ cd roc-lab2
$ bundle install
$ rake db:migrate
$ rails server - Goto http://localhost:3000
- Be sure to see NOTES for more commands and tips.
- Rails for Windows: http://Railsinstaller.org
- Slides: https://github.com/downloads/kudelabs/roc-lab2/Rails%20on%20Campus%20-%20SCAU%20s2.pdf
- Rails Documentation: http://guides.rubyonrails.org/getting_started.html
- Lab #1: https://github.com/kudelabs/roc-lab1
Rails on Campus is a program started by Leon Du and Shaokun Wu, 2 ruby developers in Guangzhou, China. The idea is to build a good set of material for introduction courses that can be used to teach Rails on college campuses. College students are often not exposed to newer technology, and are left to learn on the job. The goal of this program is to introduce students to the world of open source development frameworks to help prepare them for a good job.
Rails on Campus is sponsored by:
- gzruby - The Guangzhou Ruby Group http://groups.google.com/group/gzruby
- Kudelabs http://kudelabs.com
- Beansmile http://beansmile.com