Homework 10 serene-harbor-1038.herokuapp.com/
For this homework assignment we were supposed to add javascript/jquery to our app to add some functionality in some way. I created a button that allows the user to toggle whether or not they want to see the attending users for an event. The attending users are shown by default but clicking the button changes the test in the button and either hides or shows the attending users.
Homework 9
serene-harbor-1038.herokuapp.com/
For this homework we were supposed to add 4 quieres. I added one to sort the users on the index page in alphabetical order. And I added 3 to the events. One to sort the events into alphabetical order. Another to find all users attending an event and to list 5 of them. And then another to find all movies listed in an event and to display all of them.
1.) User Controller Method index - sorts users alphabetically 2.) Event Controller Method index - sorts events alphabetically 3.) Event Controller Method show - shows 5 users attending 3.) Event Controller Method show - shows movies up for voting
Homework 8
serene-harbor-1038.herokuapp.com/
For this homework we were supposed to add at least one addon. I decided to add sendgrid to my app. For now it emails the creator of an event when a user adds a movie to their event. I didn’t really have any problems adding this addon to the app. While the current set up does work, I’m also hoping to add checking so that a person doesn’t get emailed if they add a movie to their own event and later on when I finish the voting system I hope to email the creator of the event with the result of the movie voting poll.
Homework 7
serene-harbor-1038.herokuapp.com/
For this homework we were supposed to add at least 3 validations (of at least 2 different kinds) to our project. I added 3 validations to my events and these validations have 2 different types. I also added 3 validations to my moives and 2 validations to my events. I also fixed the problem where the event showed the id of the creating user as opposed to the user’s name. The only problem I had was trying to create a regex for email validation but after checking on StackOverflow I realized that it was a lot more work than I anticipated and would thus have to look into it more before applying it to my project. I also had some trouble with validating length of the movie description but I realized it was because I had forgotten to save that field and so it was an easy fix.
Homework 6
serene-harbor-1038.herokuapp.com/
For this homework we were supposed to add another gem to our project and I added devise. I picked devise because I knew I would need users to have accounts specific to them. I might consider adding the gem that links with facebook also, but that would be after I submit this assignment. The only problem I had was with rake db:migrate. It would bring up errors because email was defined twice (once in my User model and once from devise). However, after running rake db:reset (a suggestion on stackoverflow) things seemed to work out both locally and on heroku.
Homework 5
serene-harbor-1038.herokuapp.com/
In this homework assignment I added editing, deleting, and showing functionality for every entry in the table. The show page shows the relevant information for what you are looking at. The Edit page allows you to edit the information of a given entry and then takes you to the show page for that entry so you can see the changes have occured. The delete function allows you to delete an entry. I had some trouble getting the actual names of the belongs_to fields to show up and not the id’s but I just had to think about it a little before I got it. I also had a little trouble with deploying becasue some of my controllers acted funny, but I fixed it by running “heroku run rake db:setup”.
Homework 4
serene-harbor-1038.herokuapp.com/
In this homework assignment I made the 3 tables for my Users, Events, and Movies. I made it so that if you go to the new page for any of the 3 controllers you get to fill out a form to create a new entry in the database and then it redirects to the index to show all entries in the database. The landing page has links to the new paths for each table and a link to the index. I mostly had trouble with the link_to syntax but I was able to figure it out pretty quickly with the documentation.
Schema: Users name:string email:string password:string Events event_name:string event_date:string vote_end_time:string creator_id:integer
Movies title:string release_date:string num_votes:integer event_id:integer description:text