Created profile controller, route and view.

It's under the /profile route rather than /user to avoid clashes with
autogenerated Devise pages.
This commit is contained in:
tehjaymo
2012-10-15 23:11:29 +01:00
committed by Miles Gould
parent a8eaa86d2d
commit 32fa860dbd
3 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
class ProfileController < ApplicationController
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @user }
end
end
end

View File

@@ -0,0 +1,2 @@
- content_for :title, "Profile for " + @user.username

View File

@@ -1,5 +1,5 @@
Growstuff::Application.routes.draw do
resources :crops
resources :crops, :profile
devise_for :users