Skip to content

Instantly share code, notes, and snippets.

@kushniryb
Last active November 16, 2016 22:43
Show Gist options
  • Save kushniryb/00e59528d2fc91fc9c1a245e2301530f to your computer and use it in GitHub Desktop.
Save kushniryb/00e59528d2fc91fc9c1a245e2301530f to your computer and use it in GitHub Desktop.
homework_rack

Task

Custom router & middleware implementation

Requirements

  • Implement basic authentication middleware which redirects to 401 page unless password is ILoveRuby

  • Implement custom router that handles following types of requests: GET, POST

  • Implement custom controller that responds to the following actions: index, create, show

    • index should render some basic html template
    • create
      • easy-version: should redirect to the page which displays passed params
      • hard-version: there should be a persistance layer so that this action creates a model and redirects to it
  • There should be a separate file for routes definition

  • There should be helper methods for rendering & redirection

  • RSpec tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment