Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ActionController::RoutingError in Pages#home
- Showing /Users/ihal/Desktop/GP_2011/gp_2011/app/views/shared/_feed_item.html.erb where line #3 raised:
- No route matches {:controller=>"users", :action=>"show", :id=>#<User id: 101, email: "dcbror@gmail.com",
- 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>}
- Extracted source (around line #3):
- 1: <tr>
- 2: <td class="avatar">
- 3: <%= link_to avatar_for(feed_item.user), feed_item.user %>
- 4: </td>
- 5: <td class="supportpost">
- 6:
- Trace of template inclusion: app/views/shared/_feed.html.erb, app/views/pages/home.html.erb
- Rails.root: /Users/ihal/Desktop/GP_2011/gp_2011
- Application Trace | Framework Trace | Full Trace
- app/views/shared/_feed_item.html.erb:3:in `_app_views_shared__feed_item_html_erb__1921957314978325644_2161868900_3433621597093174608'
- app/views/shared/_feed.html.erb:3:in `_app_views_shared__feed_html_erb__3711547774624300244_2162764500_305833199033439038'
- app/views/pages/home.html.erb:7:in `_app_views_pages_home_html_erb___3460931149969880935_2163851440_2772392578701987169'
- Gp2011::Application.routes.draw do
- scope ":username", :as => "user" do
- resources :supportposts
- end
- devise_for :users
- resources :supportposts, :only => [:create, :destroy, :index, :show]
- root :to => "pages#home"
- match '/:id' => 'users#show', :as => 'user'
- match '/contact', :to => 'pages#contact'
- match '/about', :to => 'pages#about'
- match '/help', :to => 'pages#help'
- class PagesController < ApplicationController
- def home
- @title = "Home"
- if user_signed_in?
- @user = User.find_by_username!(params[:id])
- @supportpost = Supportpost.new
- @feed_items = current_user.feed.paginate(:page => params[:page])
- end
- end
- class UsersController < ApplicationController
- def show
- @user = User.find_by_username!(params[:id])
- @supportposts = @user.supportposts.paginate(:page => params[:page])
- @title = @user.name
- end
- end
- class SupportpostsController < ApplicationController
- before_filter :authenticate_user!, :only => [:create, :edit, :update, :destroy]
- before_filter :authorized_user, :only => :destroy
- def create
- @supportpost = current_user.supportposts.build(params[:supportpost])
- if @supportpost.save
- flash[:success] = "Support created!"
- redirect_to root_path
- else
- @feed_items = []
- render 'pages/home'
- end
- end
- def index
- @supportposts = Supportpost.paginate(:page => params[:page])
- end
- def show
- end
- def destroy
- @supportpost.destroy
- redirect_to root_path
- end
- private
- def authorized_user
- @supportpost = Supportpost.find(params[:id])
- redirect_to root_path unless current_user?(@supportpost.user)
- end
- end
- user_supportposts GET /:username/supportposts(.:format) {:action=>"index", :controller=>"supportposts"}
- user_supportposts POST /:username/supportposts(.:format) {:action=>"create", :controller=>"supportposts"}
- new_user_supportpost GET /:username/supportposts/new(.:format) {:action=>"new", :controller=>"supportposts"}
- edit_user_supportpost GET /:username/supportposts/:id/edit(.:format) {:action=>"edit", :controller=>"supportposts"}
- user_supportpost GET /:username/supportposts/:id(.:format) {:action=>"show", :controller=>"supportposts"}
- user_supportpost PUT /:username/supportposts/:id(.:format) {:action=>"update", :controller=>"supportposts"}
- user_supportpost DELETE /:username/supportposts/:id(.:format) {:action=>"destroy", :controller=>"supportposts"}
- new_user_session GET /users/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"}
- user_session POST /users/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"}
- destroy_user_session GET /users/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"}
- user_password POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"}
- new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"}
- edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"}
- user_password PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"}
- user_registration POST /users(.:format) {:action=>"create", :controller=>"devise/registrations"}
- new_user_registration GET /users/sign_up(.:format) {:action=>"new", :controller=>"devise/registrations"}
- edit_user_registration GET /users/edit(.:format) {:action=>"edit", :controller=>"devise/registrations"}
- user_registration PUT /users(.:format) {:action=>"update", :controller=>"devise/registrations"}
- user_registration DELETE /users(.:format) {:action=>"destroy", :controller=>"devise/registrations"}
- supportposts GET /supportposts(.:format) {:action=>"index", :controller=>"supportposts"}
- supportposts POST /supportposts(.:format) {:action=>"create", :controller=>"supportposts"}
- supportpost GET /supportposts/:id(.:format) {:action=>"show", :controller=>"supportposts"}
- supportpost DELETE /supportposts/:id(.:format) {:action=>"destroy", :controller=>"supportposts"}
- root /(.:format) {:controller=>"pages", :action=>"home"}
- user /:id(.:format) {:controller=>"users", :action=>"show"}
- contact /contact(.:format) {:controller=>"pages", :action=>"contact"}
- about /about(.:format) {:controller=>"pages", :action=>"about"}
- help /help(.:format) {:controller=>"pages", :action=>"help"}
Add Comment
Please, Sign In to add comment