/app1

cis196app1

Primary LanguageJavaScript

Heroku link: intense-ridge-3945.herokuapp.com/

HW10

go to the /pets page and hover over CLICK ME to change color of the text, click on it to see the red square appear, hover over the square to change its color.

HW9

I am not using devise. I added two scopes: one for the pets_controller and one for the index view of the pets. If you now try to add a new pet, it has to be more than 4 years old or else it won’t be displayed. Additionally, Anton’s pets (my pets) are prioritized over other users’ pets, so they are shown in the top table on the /Pets page, while all other pets are listed in the second table.

HW8

I tried two addons, one of them was CloudMailin

how it works is if you send an email to cc9966cddf7e4227c6aa@cloudmailin.net (generated email address for my account) it sends an HTTP POST request to the page at myappaddress.com/incoming_mails. What I haven’t figured out yet is how to get this message and process it. So if I go to my cloudmailin settings I see that the message is delivered, but since the page at …/incoming_mails has no GET method, I cannot open it :/ I am a bit confused about how to use it really, so the delivery works fine, but I have no idea how to display it.

Instead, I added another addon Newrelic. This is a website analytics addons that gives me access to the analytics page and allows to track the number of users, website speed and the number of requests at each page. I successfully installed it and all the info is available from my heroku account. The question I have is how do I showcase this addon, since it is not accessible publicly for my website? So, how do I show that I did the homework?

HW7

custom gems: I installed the omniauth-facebook gem which allows singning in with your facebook account. I didn’t use devise so signing in doesn’t actually do anything (except for the button in the nav bar changing from Login to Logout). I had many issues with this gem, finally resolved most of them. Problems that ran into:

  • gem omniauth is not supported well on heroku, had to switch to omniauth-facebook 1.4.0

  • facebook makes you deal with ssl certificates, I had to look up solutions on stackoverflow

  • had an issue with setting the session

  • I still haven’t figured out how to show the user that he has signed in, and then redirect him to the home page

How to use it (while I was typing this I realized that I could render views to make the navigation easier, I will work on it later, so for now it’s a bit tricky to use) :

  1. I have the navigation bar on every page. If you are a new user you will see the button “Login”

  2. “Login” redirects you to the login page, on this page click on “Connect with Facebook”

  3. enter your facebook credentials, it will then redirect you back to my app and say “Hi [your name]! You’ve signed up”

  4. this page has no navigation bar, so you then have to manually type in my website address.

  5. when you are back on the main page, “Login” has changed to “Logout”

  6. you can now log out. When you click on “Logout” it redirects you to the home page.

  7. If you now log in again, it will say “Welcome back [your name]! You have already signed up”, since you are already

in the database. This page also has no nav bar yet.

The main issue is that logging out doesn’t actually end the facebook session, so when you log in again it automatically logs you in with your current facebook account. To test multiple facebook accounts you have to first log out from facebook and then log in with my app, in this case you will be prompted to the facebook login page. I don’t know how to deal with this issue. This only happens when you click “Login” for the second time, the first-time login works fine.

Note, this functionality conflicts with the previous users functionality, so destroying a user from the Users table will not allow you to login again as that user, so for this assignment don’t try to destroy users.

WARNING! If you log in with your facebook account I will be able to see your facebook name and your email, so if this is a problem for you just create a fake facebook account for testing.

HW6

3 validations:

  • name can’t be blank

  • email should have correct format

  • password should be at least 6 characters

Styles:

  • added bootstrap navigation bar with affix()

  • added body/content style to all pages

HW3

added image, 4 different inputs, link to my github repo.

What I did: used divs to position the containers properly, applied styles to divs, that’s it

Issues: no issues

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

Please feel free to use a different markup language if you do not plan to run rake doc:app.