diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 78bb6cb..9962a97 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,7 @@ class UsersController < ApplicationController def show puts "SHOW" - @user = User.find_by username: params['id'] + @user = User.find_by username: params['username'] puts @user end end diff --git a/config/routes.rb b/config/routes.rb index f4be2c8..01a47b6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,9 @@ Rails.application.routes.draw do - resources :users, only: [:show] do + + get '/:username', to: 'users#show', as: 'users' do resources :items end + devise_for :users get 'static_pages/home' get 'static_pages/help'