- Find a coding buddy.
- Complete Ruby on Rails course (course 4) by mid-January, 2015.
- Complete Michael Hartl: Ruby on Rails at the same time.
- Observe workings of Odin Project behind the scenes.
- Start contributing to Odin Project -February 2015.
Ran into my first challenge with the blogger today. I was creating a new model for a Comment feature and I typed: $ bin/rails generate model Comment author_name:string body:text article s :references That single red letter cost me an hour of struggle (I mean 'learning'). The extra s created a database schema containing something called 'articles_id'. Since id is a property of a single article, the comment controller couldn't find an id for articles, as it didn't exist. I looked at the Comment model file and saw the extra s almost immediately after trying to enter a comment. But then I couldn't reverse the error. Rolling back the migration ( rake db:rollback), had no effect on the schema. Destroying the model ( rails destroy model Comment) had no effect on the schema. In the end I replaced the my local files with the Github repo contents (luckily I had just done a push). git fetch --all git reset --hard or...
Comments
Post a Comment