Giter Site home page Giter Site logo

rails-create-action-lab-dc-web-051319's Introduction

Create Action Lab

  1. Build a working create action
  2. Use a form_tag to create a new form that submits to the index action
  3. Correctly name form fields so that they end up at the top level of the params hash
  4. Assign data from params to a Student object in the create action
  5. Save that Student object in the create action
  6. Create a redirect_to from the create action to the show action

Instructions

Many of the spec tests are already passing for this lab, but there are some additional ones –– including our first use of controller tests –– located here:

  • Controller Specs - specs/controllers/students_controller_spec.rb

  • Capybara Specs - specs/features/student_spec.rb:37

When this lab is complete, your application should have the following behavior:

  1. User fills out the form on students/new

  2. When the form is submitted, a new record is created in the database

  3. After the user submits the form, they are redirected to the show page that renders the Student record that they created

Make sure to use a route helper method to redirect to the show page at the end of the create method. You can find the correct syntax for this route by running rake routes in the terminal.

Resources

View Create Action Lab on Learn.co and start learning to code for free.

rails-create-action-lab-dc-web-051319's People

Contributors

maxwellbenton avatar annjohn avatar jordanhudgens avatar pletcher avatar danielseehausen avatar jmburges avatar dakotalmartinez avatar perpepajn25 avatar

Watchers

 avatar

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.