Reputation: 2080
So this is interesting. I edited a user profile, and it moved in the database on heroku from what I can tell. It is now below row 15, and it has an id of 1. Here is the output from console, after connecting to the heroku db:
3 | Danyka | Jones | filip_nikolaus | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.252597 | 2015-09-02 05:37:35.252597 |
4 | Angelina | Kub | ebbarempel | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.258762 | 2015-09-02 05:37:35.258762 |
5 | Bo | Barton | per_hammes | pass | | http://www.theunpluggedwoodshop.com/wp-content/uploads/2012/10/giving-tree-1.jpg | Add quote.. | | | 2015-09-02 05:37:35.26435 | 2015-09-02 05:37:35.26435 |
6 | Tristian | Vandervort | ulf | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.269916 | 2015-09-02 05:37:35.269916 |
7 | Bert | Cartwright | annaschinner | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.275477 | 2015-09-02 05:37:35.275477 |
8 | Lina | Shanahan | martin | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.28096 | 2015-09-02 05:37:35.28096 |
9 | Laurel | Greenholt | hannahirthe | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.286482 | 2015-09-02 05:37:35.286482 |
10 | Victor | Becker | ingegerd_altenwerth | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.292822 | 2015-09-02 05:37:35.292822 |
11 | Devonte | Borer | ullabritt | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.298556 | 2015-09-02 05:37:35.298556 |
12 | guest | guest | guest | $2a$10$ntdETJrdzHPwqEeq2Kqeme3DeU9zzi8mlz/WIUTWGWwX2ijs5vkpO | | http://img03.deviantart.net/3e34/i/2011/227/8/c/epik_face_by_epikfaceplz-d46p2on.png | | | | 2015-09-03 14:48:22.145592 | 2015-09-03 14:49:26.494595 |
13 | Linda | Marie | lindaM | $2a$10$wOlYIjTVHkHReXMlcpHNReLM/V4tMTaItnNKhuRKgc2gVwlaA9r6e | | http://tremendouswallpapers.com/wp-content/uploads/2014/12/quaker-parrots-1920x1200.jpg | | | | 2015-09-04 18:01:33.644988 | 2015-09-10 04:28:42.886892 |
15 | Linda | Gaiud | codemom | $2a$10$J..1/Kyx3isJTkAJv11bf.5/DYQccXBonf9ji6U4v/szYE3Dfm89S | | https://www.denverlibrary.org/files/css_code.jpg | | | | 2015-09-08 01:59:28.34503 | 2015-09-10 04:31:01.938624 |
1 | admin | admin | admin | $2a$10$os7EetTB/e.Lfarbvt/BFO1SW.SDC9tkaE5zlprvsmF1BaKniSWi6 | | https://scontent-lga1-1.xx.fbcdn.net/hphotos-xfa1/v/t1.0-9/11119092_10206950218382306_4406697530463059534_n.jpg?oh=3b6578dc010d0ef918008fd5b96b2e18&oe=566808E1 | No one is useless in this world who lightens the burdens of another. \r+| | | 2015-09-02 05:37:35.146649 | 2015-09-12 02:52:15.04786 | t
| | | | | | | - Charles Dickens | | | | |
(13 rows)
For some reason when I click on that users name, instead of taking me to that profile, I get an error that the page can not be found despite it obviously existing in the DB. Here is what the url looks like when it hits that route:
https://boiling-stream-6729.herokuapp.com/users/1
the controller is pretty standard:
def show
@user = User.find(params[:id])
@allContributions = Payment.where(user_id: @user.id).to_a
@userContributions =[];
@allContributions.each{|c| @userContributions << Project.find(c.project_id)}
@allContributions
end
ANY other profile I go to, I don't have this problem, so I can only conclude it is because it has been shifted down in the db. I do not however understand what that would matter, or what I should do about it. Any input as to what is happening as well as what to do is appreciated!
Upvotes: 1
Views: 36
Reputation: 34338
You should check your heroku log
first. As I can see your show
method is doing a bunch of things, I am sure something is failing because it can't find some related resource. Your heroku log
should tell you about that. In such cases, it's always best to check the log first to see the exact error message.
Upvotes: 1