Skip to content

apemaj/routeexamples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This example repo explains the connection between routes and controllers in rails diagram of request, route, and controllers

It also is meant to serve as a quick intro to ruby for students so make sure to explain how both things work while running through examples with students.

All of the following steps should ideally be done with the students copying you

  1. Create a new app with rails new
  2. Go into app/controllers/application_controller.rb and remove forgery protections
    • This will make it easier to curl posts and the like against the project
  3. Starting at the top of app/controllers/example_controller.rb
    • Copy/type over methods into your example application
    • Create a route to point to that method as shown in config/routes.rb
    • Rinse and repeat for games_controller and/or search_controller until you get bored or run out of time
  4. Encourage students to attempt to solve the problems shown in the completed_exercises_controller

About

Super simple examples of rails routing and ruby code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 80.7%
  • HTML 13.8%
  • JavaScript 2.8%
  • CSS 2.2%
  • CoffeeScript 0.5%