Guest User

Untitled

a guest
Jan 26th, 2018
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.63 KB | None | 0 0
  1. ActionController::RoutingError in Pages#home
  2.  
  3. Showing /Users/ihal/Desktop/GP_2011/gp_2011/app/views/shared/_feed_item.html.erb where line #3 raised:
  4.  
  5. No route matches {:controller=>"users", :action=>"show", :id=>#<User id: 101, email: "dcbror@gmail.com",
  6.  
  7. encrypted_password: "$2a$10$zciSm1SF5UhnZ//b4M9k6.47e.14UKBtB.I/C4hsddjo...", password_salt: "$2a$10$zciSm1SF5UhnZ//b4M9k6.", reset_password_token: nil, remember_token: nil, remember_created_at: nil, sign_in_count: 3, current_sign_in_at: "2011-03-16 23:14:57", last_sign_in_at: "2011-03-14 23:57:53", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2011-03-14 10:42:21", updated_at: "2011-03-16 23:14:57", name: nil, username: nil, avatar: nil>}
  8.  
  9. Extracted source (around line #3):
  10.  
  11. 1: <tr>
  12. 2: <td class="avatar">
  13. 3: <%= link_to avatar_for(feed_item.user), feed_item.user %>
  14. 4: </td>
  15. 5: <td class="supportpost">
  16. 6:
  17.  
  18. Trace of template inclusion: app/views/shared/_feed.html.erb, app/views/pages/home.html.erb
  19.  
  20. Rails.root: /Users/ihal/Desktop/GP_2011/gp_2011
  21. Application Trace | Framework Trace | Full Trace
  22.  
  23. app/views/shared/_feed_item.html.erb:3:in `_app_views_shared__feed_item_html_erb__1921957314978325644_2161868900_3433621597093174608'
  24. app/views/shared/_feed.html.erb:3:in `_app_views_shared__feed_html_erb__3711547774624300244_2162764500_305833199033439038'
  25. app/views/pages/home.html.erb:7:in `_app_views_pages_home_html_erb___3460931149969880935_2163851440_2772392578701987169'
  26.  
  27.  
  28.  
  29.  
  30.  
  31. Gp2011::Application.routes.draw do
  32.  
  33. scope ":username", :as => "user" do
  34. resources :supportposts
  35. end
  36.  
  37. devise_for :users
  38.  
  39. resources :supportposts, :only => [:create, :destroy, :index, :show]
  40.  
  41. root :to => "pages#home"
  42.  
  43. match '/:id' => 'users#show', :as => 'user'
  44.  
  45. match '/contact', :to => 'pages#contact'
  46. match '/about', :to => 'pages#about'
  47. match '/help', :to => 'pages#help'
  48.  
  49.  
  50. class PagesController < ApplicationController
  51. def home
  52. @title = "Home"
  53. if user_signed_in?
  54. @user = User.find_by_username!(params[:id])
  55. @supportpost = Supportpost.new
  56. @feed_items = current_user.feed.paginate(:page => params[:page])
  57. end
  58. end
  59.  
  60.  
  61.  
  62. class UsersController < ApplicationController
  63.  
  64. def show
  65. @user = User.find_by_username!(params[:id])
  66. @supportposts = @user.supportposts.paginate(:page => params[:page])
  67. @title = @user.name
  68. end
  69. end
  70.  
  71.  
  72.  
  73.  
  74. class SupportpostsController < ApplicationController
  75.  
  76. before_filter :authenticate_user!, :only => [:create, :edit, :update, :destroy]
  77. before_filter :authorized_user, :only => :destroy
  78.  
  79. def create
  80. @supportpost = current_user.supportposts.build(params[:supportpost])
  81. if @supportpost.save
  82. flash[:success] = "Support created!"
  83. redirect_to root_path
  84. else
  85. @feed_items = []
  86. render 'pages/home'
  87. end
  88. end
  89.  
  90. def index
  91. @supportposts = Supportpost.paginate(:page => params[:page])
  92. end
  93.  
  94. def show
  95.  
  96. end
  97.  
  98. def destroy
  99. @supportpost.destroy
  100. redirect_to root_path
  101. end
  102.  
  103.  
  104. private
  105.  
  106. def authorized_user
  107. @supportpost = Supportpost.find(params[:id])
  108. redirect_to root_path unless current_user?(@supportpost.user)
  109. end
  110. end
  111.  
  112.  
  113.  
  114. user_supportposts GET /:username/supportposts(.:format) {:action=>"index", :controller=>"supportposts"}
  115. user_supportposts POST /:username/supportposts(.:format) {:action=>"create", :controller=>"supportposts"}
  116. new_user_supportpost GET /:username/supportposts/new(.:format) {:action=>"new", :controller=>"supportposts"}
  117. edit_user_supportpost GET /:username/supportposts/:id/edit(.:format) {:action=>"edit", :controller=>"supportposts"}
  118. user_supportpost GET /:username/supportposts/:id(.:format) {:action=>"show", :controller=>"supportposts"}
  119. user_supportpost PUT /:username/supportposts/:id(.:format) {:action=>"update", :controller=>"supportposts"}
  120. user_supportpost DELETE /:username/supportposts/:id(.:format) {:action=>"destroy", :controller=>"supportposts"}
  121. new_user_session GET /users/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"}
  122. user_session POST /users/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"}
  123. destroy_user_session GET /users/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"}
  124. user_password POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"}
  125. new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"}
  126. edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"}
  127. user_password PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"}
  128. user_registration POST /users(.:format) {:action=>"create", :controller=>"devise/registrations"}
  129. new_user_registration GET /users/sign_up(.:format) {:action=>"new", :controller=>"devise/registrations"}
  130. edit_user_registration GET /users/edit(.:format) {:action=>"edit", :controller=>"devise/registrations"}
  131. user_registration PUT /users(.:format) {:action=>"update", :controller=>"devise/registrations"}
  132. user_registration DELETE /users(.:format) {:action=>"destroy", :controller=>"devise/registrations"}
  133. supportposts GET /supportposts(.:format) {:action=>"index", :controller=>"supportposts"}
  134. supportposts POST /supportposts(.:format) {:action=>"create", :controller=>"supportposts"}
  135. supportpost GET /supportposts/:id(.:format) {:action=>"show", :controller=>"supportposts"}
  136. supportpost DELETE /supportposts/:id(.:format) {:action=>"destroy", :controller=>"supportposts"}
  137. root /(.:format) {:controller=>"pages", :action=>"home"}
  138. user /:id(.:format) {:controller=>"users", :action=>"show"}
  139. contact /contact(.:format) {:controller=>"pages", :action=>"contact"}
  140. about /about(.:format) {:controller=>"pages", :action=>"about"}
  141. help /help(.:format) {:controller=>"pages", :action=>"help"}
Add Comment
Please, Sign In to add comment