|
|
@@ -12,14 +12,14 @@ class UsersController < ApplicationController |
|
|
|
|
|
|
|
# GET /users/1 |
|
|
|
# GET /users/1.json |
|
|
|
def show |
|
|
|
@user = User.find(params[:id]) |
|
|
|
|
|
|
|
respond_to do |format| |
|
|
|
format.html # show.html.erb |
|
|
|
format.json { render json: @user } |
|
|
|
end |
|
|
|
end |
|
|
|
# def show |
|
|
|
# @user = User.find(params[:id]) |
|
|
|
# |
|
|
|
# respond_to do |format| |
|
|
|
# format.html # show.html.erb |
|
|
|
# format.json { render json: @user } |
|
|
|
# end |
|
|
|
# end |
|
|
|
|
|
|
|
# GET /users/new |
|
|
|
# GET /users/new.json |
|
|
@@ -44,7 +44,7 @@ class UsersController < ApplicationController |
|
|
|
|
|
|
|
respond_to do |format| |
|
|
|
if @user.save |
|
|
|
format.html { redirect_to @user, notice: 'User was successfully created.' } |
|
|
|
format.html { redirect_to users_path, notice: 'User was successfully created.' } |
|
|
|
format.json { render json: @user, status: :created, location: @user } |
|
|
|
else |
|
|
|
format.html { render action: "new" } |
|
|
@@ -71,13 +71,13 @@ class UsersController < ApplicationController |
|
|
|
|
|
|
|
# DELETE /users/1 |
|
|
|
# DELETE /users/1.json |
|
|
|
def destroy |
|
|
|
@user = User.find(params[:id]) |
|
|
|
@user.destroy |
|
|
|
|
|
|
|
respond_to do |format| |
|
|
|
format.html { redirect_to users_url } |
|
|
|
format.json { head :no_content } |
|
|
|
end |
|
|
|
end |
|
|
|
# def destroy |
|
|
|
# @user = User.find(params[:id]) |
|
|
|
# @user.destroy |
|
|
|
# |
|
|
|
# respond_to do |format| |
|
|
|
# format.html { redirect_to users_url } |
|
|
|
# format.json { head :no_content } |
|
|
|
# end |
|
|
|
# end |
|
|
|
end |