/tour_scheduler

This is a challenge to create a tour scheduler with mailer support

Primary LanguageRuby

Tour Scheduler

This is a challenge exercise to create a scheduler and through a confirmation process, create a tour and email the details to the user and the tour provider.

Project by Randy Leighton

- First, here is the problem given:

Create this simple Rails application (sinatra or any other rack framework is also acceptable). Write functional code in the most efficient manner and with your best workmanship. Focus on showing us clear logic, best practices and your methodologies/design patterns – your choice of these is part of the review process. Don’t try to future-proof the app, either. We’re fans of simple, concise code. You’re building a website that has a “tour scheduling” feature:


  1. User requests a tour, and provides their email address. We send an activation email.


  2. User clinks link in activation email, which takes them to a form where they enter their first name, last name and phone number. When submitting that, they’re shown another form.


  3. This form asks for some extra details: preferred tour date, additional questions (nothing fancy, a basic string will work), and asks them to choose a list of amenities they’re interested in (use this list for demonstration purposes: “pool”, “rec room”, “movie theater”, “on site doctor”, “time machine”).


  4. Once this last form is submitted they should be presented with a success screen and a confirmation email should be sent to the user. A “New Tour Scheduled” email should be delivered to tours@example.com with the users information, their requested tour information and the IP address used to request the tour.


  5. If the user clicks the same link again, they should be presented with their already submitted data (except the ip address), with an opportunity to rate their experience at the tour on a scale of 1-5.

Views don’t need to be styled in any way; plain HTML elements with no CSS at all is fine. You can use whatever gems or plugins you want.  Create tests if that is how you work and write code. When you’re done, put it on GitHub as an app that we can run. Include a readme with whatever it takes to get it up and running.

App Status

Step 1

I start with a welcome controller where the user starts out. They choose to schedule a tour and this creates a new user object with the user controller. It only takes the email from them and uses hidden values for what is needed in step 2. They are required in the model for creation. Then I send out a mailer confirmation upon user creation to give them a link to confirm.

Step 2

The user now is loading to the user edit form and updating their information. It is updated and then the user is sent to the next form: This is going to be the tour creation form

Step 3

I am currently here as of Friday night. Continued for a few hours on Sunday. Step 3 creates a new tour object, passes in the user information and uses a checkbox to allow them to pick from amenities. So far this was the most challenging thing to work on, it was pretty awesome to get work and see the values going back into the controller. I was then starting to work on the user IP address, and though I started on it, time ran out and it i WIP.

Step 4

This leaves off at step 4 on 12/14 to do what I could in 5-6 hours.

This is ruby 2.1.1 and Rails 4.1.8 and PostgreSQL

Instructions:

Clone the repo, bundle install, the run the rails server and use localhost:3000 in the browser. To have the ability to select Amenities, go into the rails console and create them with Amenities.create({description:“pool”}) etc - This pulls them from that table.