Giter Club home page Giter Club logo

rails-dynamic-request-lab's Introduction

Rails Dynamic Request Lab

Objectives

  • Draw a route with a dynamic variable

  • Use a routes variable in params within the logic of an action

  • Assign an instance variable in a controller action

  • Use a controller instance variable to generate a dynamic ERB template.

  • Build a classical show action/view

Instructions

There are three RSpec/Capybara specs in this lesson; you can find them in spec/features/student_spec.rb. Make sure they pass without breaking the other tests. To complete this section, all specs should pass.

In this lab, you will work through the full MVC pattern by building a student management app for The Flatiron School. At a high level, you will integrate the following scenario in your application:

  1. The user is able to go to /students/2 to receive information on the student with an id of 2

  2. The application should render the values from the student record in the database

Keys to remember

  • Make sure that you use a route variable for the show request path

  • If you google around and discover generators/scaffolds, don't use them for this lab

Resources

rails-dynamic-request-lab's People

Contributors

annjohn avatar danielseehausen avatar dependabot[bot] avatar franknowinski avatar ihollander avatar jmburges avatar jordanhudgens avatar maxwellbenton avatar pletcher avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rails-dynamic-request-lab's Issues

Official solution doesn't pass the tests

Just a heads up about this: the difference is in the routes -- if you use
get "students/:id", to: "students#show"
as it suggests, instead of
resources :students, only: [:index, :show]
end,
the tests won't pass when "index" is missing.

Also, the relationship between this session's lesson and the lab, isn't good. It's the start of rails, and there should be more explanation about routes, since this is a big change from Sinatra. The list of requirements should be clearer and more descriptive, again, because this is the beginning of Rails and things are very unclear. The lessons go over the big picture of RESTful conventions, which is great, but to improve the intro to Rails, definitely include more on the specifics of routing, and the new relationships of MVC.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.