Coder Social home page Coder Social logo

rails-amusement-park's Introduction

Rails Amusement Park

Learning Goals

  • Use form helpers
  • Work with multiple models that interact with each other
  • Build a simple sessions system

Instructions

You're going to be building an amusement park. There will be users, attractions, and users can take rides on attractions.

  • This is a test driven lab, check out the model tests and get those to pass before moving onto the feature specs.
  • Remember, if you use scaffolds or generators do not overwrite the model specs that are included in this lab. Always use the --no-test-framework flag and enter n or no when prompted to overwrite the model specs for this lab.

A hint about requiring a password: ActiveRecord comes with a handy has_secure_password attribute that you can set on a model. It requires that you enable the bcrypt gem and that you add a password_digest column to your model. You can read more about has_secure_password here.

If you want to see the completed version of the app, you can check out the solution branch and run it locally:

$ git checkout solution
$ bundle install
$ rails db:migrate db:seed
$ rails s

After running these commands, the finished app will be available on http://localhost:3000/.

After viewing the solution, you can switch back to the default branch:

$ git checkout master

Resources

rails-amusement-park's People

Contributors

curiositypaths avatar danielseehausen avatar hansenjl avatar ihollander avatar johann avatar kkterai avatar lizbur10 avatar maxwellbenton avatar morgvanny avatar sdcrouse avatar sgharms avatar sylwiavargas avatar taoliu12 avatar timothylevi avatar

Stargazers

 avatar

Watchers

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

rails-amusement-park's Issues

@user.update does NOT work when bcrypt is being used

In the spec users_features_spec.rb, line 250, 260 and 270

@user.update is used but will not update the user because in order to update a record with an encrypted password the .update_attribute call needs to be made.

Potential Turbolinks/Sass conflict causing test failure

Technical coach feedback:

A student working on this lab was repeatedly running into this error:

`Failure/Error: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

  ActionView::Template::Error:
    Invalid CSS after "...top: 4px solid ": expected ";", was "\	;"
  # (sass):4014

`
This error was replicated on my machine, and when I cloned down another student's lab who had recently made a pull request, I got the same error. We were able to get rid of the error by commenting out the these two lines in the application.html.erb layout:

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

Thank you for spotting this issue and providing feedback.

Thank you for spotting this issue and providing feedback.

We have updated the materials and believe your issue to have been resolved.
Note, however, that if you are working in Canvas the changes may not show up
right away.

We apologize for any frustration you might have encountered during this process
but thank you for helping us ensure that those who follow in your path will not
encounter the same problems that you faced.

If you do not believe that this issue has been addressed, please re-open this
issue. ๐Ÿ’™

Originally posted by @lizbur10 in #26 (comment)

Marked incomplete despite completing this lab 3 months ago

Suddenly this lab is marked as incomplete, but I completed it several months ago. So Learn thinks I'm 'currently working on' this lab even though I'm already several units ahead. I've tried resubmitting the lab in order to 'complete' it but because it appears the same as the lesson's (because I think there's an issue with the solution being included), it will not let me push my version up to Github.

spec/support/login_helper.rb method admin_login

Method to log in a registered admin user looks for wrong password field, line 28

Existing: fill_in("password"), :with => "password")

Edit: fill_in("user_password", :with => "password")

This method should look for the same field that method user_login looks for (on line 21)

run bundle update

for this error # --- Caused by: --- # Sass::SyntaxError: # Invalid CSS after "...top: 4px solid ": expected ";", was "\ ;" # (sass):4014

run bundle update, and it will update the sass gem from 3.7.0 to 3.7.2, which should resolve this error

Known Issues

Problem: Master and Solution branch are out of sync. Simply merging master into solution will not work as the solution will be deleted from the solution branch.

Notify: @justinddaniel

just got the completed lab when I used learn open

went to open this lab via the learn open command, and when the files opened up in my text editor, they looked like they were all done. ran learn, and all 62 tests came back passed. looks like it may have had the solution branch merged into the master branch last week because the master branch has 'all tests passing' as the commit messages for the file folders.

Can it be reset so I can do this lab?

Link to "where this is headed" is an error page (ironically its right, because Ill also be getting errors if i dont know what im doing!)

Thanks for raising this issue! Future learners thank you for your diligence. In
order to help the curriculum team address the problem, please use this template
to submit your feedback. We'll work on addressing the issue as soon as we can.

Please fill out as much of the information below as you can (it's ok if you
don't fill out every section). The more context we have, the easier it will be
to fix your issue!

Note: you should only raise issues related to the contents of this lesson.
If you have questions about your code or need help troubleshooting, reach out to
an instructor/your peers.


Link to Canvas

https://learning.flatironschool.com/courses/1881/assignments/125553?module_item_id=259466

Add a link to the assignment in Canvas here.

What should be changed?

The link to what i'm supposed to be buildin!

Suggest your change here. Let us know what section or line of the Readme needs
to be updated, and any proposed corrections. Include the line number(s) if
possible.

Additional context

Small readme, figure its clear!

Add any other context about the problem here.

Please rewrite this spec

Hello. This lab's spec is extremely confusing in many ways and was extremely frustrating.

  1. The line ' # user_signup method is defined in login_helper.rb' in users_features_spec.rb is misleading and leads one to think they need to create a user_signup & user_login method and a module called login_helper
  2. The specifics about how mood translates from a number to a word is required to pass the first test, but isn't mentioned until maybe the 3rd spec.
  3. Requirements on what actual pages are needed or controllers are not at all specified. While I understand that they are needed, since there is no spec for them, I don't know what the tests are expecting. Views are not specified at ALL. These specs do not flow in a way for people who don't know what the entire lab is supposed to be and are coding along with the tests.
  4. The requirement that the index page and the users/new page be linked to users#new route is very confusing
    I'm still on the first spec test, so I apologize if this issue is too early to write. I spent the last 3 hours working on the first issue with 2 learn experts for more than half this time. Thanks for your time!

Solution in the master branch?

I cloned from github and it appears the master branch is the solution. I ran tests and they all passed without me having to solve anything. Is there anyway for this to be changed and then I can complete the lab? Thanks!

Re-do this github directory

Hi,

The solution code is the one that is the default fork and clone.
I'll erase mine and start from scratch, but when I ran $ learn in my terminal, I started off by passing all 63 tests.

I'm sure it was just a mistake from the roll-out of version 5 of the curriculum today.
Thanks,
Jeff

Grammar Issue on Line 251 of Test Cases

The line reads

expect(page).to have_content("You do not have enough tickets the #{@ferriswheel.name}")
expect(page).to have_content("Tickets: 1")

I assume it should read "You do not have enough tickets..to ride...

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.