Railsbridge
(http://railsbridge.org/)
Learn to code or level up with RailsBridge!
RailsBridge workshops are a free and fun way to get started or level up with Rails, Ruby, and other web technologies. Our events focus on increasing diversity in tech, so that people of all backgrounds can feel welcome and comfortable in our industry.
We teach people to code because we believe that the people making technology should accurately reflect the diversity of those using it.
We want to push for all kinds of diversity in tech: gender, race, sexual orientation, ability, and class. Women were the first population we focused on, but aren’t the last.
We value acceptance, enthusiasm, and hard work. The RailsBridge community thrives on optimism and a love for making great things.
Setup
Installfest
(http://docs.railsbridge.org/installfest/)
Instructions for installing Ruby and Rails on your computer. You need to complete these steps before starting a Rails workshop! HIGHLY RECOMMENDED!
This is a set of step-by-step instructions for installing Ruby, Rails, and other important tools on Mac, Windows, or Linux computers. Originally developed for the Railsbridge Workshops, it is a community-supported open-source documentation project.
- Installfest
- Choose Your Operating System
- Configure Git
- Create An SSH Key
- Create A Heroku Account
- Create A Rails App
- Deploy A Rails App
- Get A Sticker
- Clean Up
Rails
Intro To Rails
(http://docs.railsbridge.org/intro-to-rails/)
The “classic” RailsBridge curriculum (Suggestotron). Takes you step-by-step through making a Rails app, one command at a time, using helpers like rails generate scaffold
, and deploying that app to the Internet.
To teach you Ruby on Rails we are going to use a “Real World” example. You’ve decided to create a voting system for you and your friends to play with. You’ve decided at a minimum, you’d like to allow users to:
- view the topics sorted by number of votes
- vote on topics
- create, edit, and destroy topics
You’ve sketched up an initial screenshot of what you want it to look like:
- Intro To Rails
- Ruby Language
- Getting Started
- Add The Project To A Git Repo
- Running Your Application Locally
- Creating A Migration
- CRUD With Scaffolding
- Setting The Default Page
- Voting On Topics
- Hooking Up Votes And Topics
- Allow People To Vote
- Redirect To The Topics List After Creating A New Topic
- Make The Topic Title A Link
- Clean Up Links On The Topics List
- Credits And Next Steps
Glossary
(http://docs.railsbridge.org/installfest/glossary)
If you are ever stuck trying to make sense of all this alphabet soup – these glossaries may be helpful!
Have a look at the general Glossary, the Command Line Glossary, and the Ruby and Rails Glossary.
Commands
(http://docs.railsbridge.org/message-board/commands)
Ruby
Open an interactive Ruby terminal (type ‘exit’ to quit)
irb
Run a ruby program named FILENAME.rb
ruby FILENAME.rb
Installs a gem called GEMNAME
gem install GEMNAME
Installs gems listed in the Gemfile
bundle install
Rails
Create a new rails project called NAME
rails new NAME
Auto-generate routes (this can also be done manually)
rails generate scaffold
Create a new [Rails model]
rails generate model MODELNAME
Update the database to match what you have described in your code
rake db:migrate
Run the application locally (Ctrl-C to quit)
rails server
Start an interactive Ruby session that knows about your Rails models (type ‘exit’ to quit)
rails console
Print the routes for your application
rake routes
Browser
Go to the root page of your rails application
http://localhost:3000
Git
Creates a new git repository in your current directory.
git init
Add the current directory, and all sub directories, to your git repository.
git add .
Tells you what you’ve added, deleted, and changed between your current directory and you local git repository.
git status
Prints the difference between FILENAME and what is in your local git repository.
git diff FILENAME
Commit the files you’ve added to the local repository.
git commit -m "Describe what has changed, and why" .
Push committed changes to the remote server.
git push
Deploying to Heroku
First-Time Setup
(http://docs.railsbridge.org/intro-to-rails/deploying_to_heroku#every-time)
Every-Time
(http://docs.railsbridge.org/intro-to-rails/deploying_to_heroku#every-time)
Job Board
(http://docs.railsbridge.org/job-board/)
Build a simple job board from scratch with a little less of the magic of Rails scaffolding. This curriculum is great for a second or third RailsBridge attendee or for students who want to focus on how the app is wired together. (This curriculum doesn’t include deploying to the Internet.)
Ruby
Learn To Code
(http://docs.railsbridge.org/learn-to-code/)
A course which teaches how to code from the ground up, using Alex’s Learn To Code In Ruby curriculum. It’s geared towards people who may never have written code before and teaches just enough Ruby to get across basic principles like variables, objects, and the command line.
Contents
- Learn To Code
- Computers
- Objects
- Strings
- Numbers
- Variables
- nil
- The Command Line
- Input And Output
- Logic
- Loops
- Arrays
- ARGV
- Hashes
- Functions
- Sinatra
- Extra
- Next Steps
Ruby
(http://docs.railsbridge.org/ruby/ruby)
A ruby-specific curriculum, expanded from the “Ruby for Beginners” slide deck. Still new, with room for your contributions.
To teach you Ruby we are going to explain the basic building blocks used in the Ruby language and allow you reinforce what you’ve learned through challenges.
When you have completed this curriculum you should understand:
- The command line and why we use it
- How to run your Ruby code interactively (irb) or from a file
- Simple types like numbers, strings, and booleans
- Data structures like arrays and hashes
- Object concepts like Classes
Contents
- irb
- Running Programs From A File
- Summary: Tools
- Overview: Building Blocks
- Variables
- Datatypes
- Strings
- Input And Output
- Numbers And Arithmetic
- Booleans
- Conditionals
- nil
- Symbols
- Working With Collections
- Arrays
- Hashes
- Loops
- Summary: Basics
- Overview: Organizing
- Functions
- Classes
- How To Write A Program
Methods vs. Functions
(http://docs.railsbridge.org/learn-to-code/methods)
- a FUNCTION is a named chunk of code with PARAMETERS and a RETURN VALUE
- a METHOD is a function that is attached to a specific object
- it has privileged access to that object’s data
- in Ruby everything’s an object, so the terms are mostly interchangeable
ToDo Learntocode
(http://docs.railsbridge.org/learn-to-code/todo-learntocode)
- diagram: memory (variables+objects)
- diagram: message passing
- interpolation?
- more on arrays
- hashes
- more labs (for students who “get it” before the rest of the room and don’t want to sit around bored (or help others))
- functions
- more array labs
- methods
- classes
- File I/O
- testing
- symbols
- rand