diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb new file mode 100644 index 000000000..bac28d586 --- /dev/null +++ b/app/controllers/profile_controller.rb @@ -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 diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml new file mode 100644 index 000000000..95a5bf973 --- /dev/null +++ b/app/views/profile/show.html.haml @@ -0,0 +1,2 @@ +- content_for :title, "Profile for " + @user.username + diff --git a/config/routes.rb b/config/routes.rb index da8709c5c..7a5148a87 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Growstuff::Application.routes.draw do - resources :crops + resources :crops, :profile devise_for :users