mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-29 12:12:57 -04:00
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:
10
app/controllers/profile_controller.rb
Normal file
10
app/controllers/profile_controller.rb
Normal 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
|
||||
2
app/views/profile/show.html.haml
Normal file
2
app/views/profile/show.html.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
- content_for :title, "Profile for " + @user.username
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Growstuff::Application.routes.draw do
|
||||
resources :crops
|
||||
resources :crops, :profile
|
||||
|
||||
devise_for :users
|
||||
|
||||
|
||||
Reference in New Issue
Block a user