Rails Girls Touristic Autism-friendly Spots App Tutorial
Created by Myriam Leggieri, @iammyr for Rails Girls Galway
This guide merges, adapts and extends some of the basic RailsGirls guides for the scenario: description, displaying and commenting touristic places and rate them with respect to their autism-friendliness. This application was requested by the Galway Autism Partnership to support autistic adults during their travelings.
The extension comprises of the following new features:
- TDD using Guide
- Resource Rating
- Authenticated User (via devise) permission setting
The basic guides that have been merged and adapted are the Ruby on Rails Tutorial, the basic RailsGirls app and the tutorials for creating thumbnails, authenticating users, adding design, deploying to OpenShift and adding comments.
0. Installation
Make sure you have Rails and Git installed. Follow the installation guide, the Installing Git section of Pro Git to get set up. Then configure GitHub by typing the following in your terminal:
one-time setup steps for GitHub.
Sign up for a free GitHub account if you don’t have one already.
1. Basic Web Application
2. Version control with Git
3. Resource Modeling
4. Resource Rating
5. Design
6. Image upload and Thumbnails
Optional - for advanced Rails Girls:
7. Continuous Deployment
8. Continuous Testing and Integration
Additional Guides
- Guide 0: Handy cheatsheet for Ruby, Rails, console etc.
- Guide 1: Put your app online with Heroku by Terence Lee / Put your app online with OpenShift by Katie Miller / Put your app online with anynines
- Guide 2: Adding profile pictures with Gravatar
- Guide 3: Go through additional explanations for the App by Lucy Bain
Appendices
Undoing things
Rails has some facilities to help you recover from mistakes.
For instance, you may decide to change the name of a controller. Since, when generating a controller, Rails creates many more files than the controller file itself, undoing the generation means removing a whole set of files. In Rails, this can be accomplished with rails destroy. In particular, these two commands cancel each other out:
Similarly, after we generate a model as follows:
This can be undone using
Migrations change the state of the database using
We can undo a single migration step using
To go all the way back to the beginning, we can use
As you might guess, substituting any other number for 0 migrates to that version number, where the version numbers come from listing the migrations sequentially.
To drop a table from the db enter
Then just type:
You can browse directly the database (if sqlite3 type “.quit” to exit afterwards) by typing
Want to learn more? View more guides!