GeoRSS aggregator and Layar augmented reality server
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

users_controller.rb 1.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. class UsersController < ApplicationController
  2. # GET /users
  3. # GET /users.json
  4. def index
  5. @users = User.all
  6. respond_to do |format|
  7. format.html # index.html.erb
  8. format.json { render json: @users }
  9. end
  10. end
  11. # GET /users/1
  12. # GET /users/1.json
  13. # def show
  14. # @user = User.find(params[:id])
  15. #
  16. # respond_to do |format|
  17. # format.html # show.html.erb
  18. # format.json { render json: @user }
  19. # end
  20. # end
  21. # GET /users/new
  22. # GET /users/new.json
  23. def new
  24. @user = User.new
  25. respond_to do |format|
  26. format.html # new.html.erb
  27. format.json { render json: @user }
  28. end
  29. end
  30. # GET /users/1/edit
  31. def edit
  32. @user = User.find(params[:id])
  33. end
  34. # POST /users
  35. # POST /users.json
  36. def create
  37. @user = User.new(params[:user])
  38. respond_to do |format|
  39. if @user.save
  40. format.html { redirect_to users_path, notice: 'User was successfully created.' }
  41. format.json { render json: @user, status: :created, location: @user }
  42. else
  43. format.html { render action: "new" }
  44. format.json { render json: @user.errors, status: :unprocessable_entity }
  45. end
  46. end
  47. end
  48. # PUT /users/1
  49. # PUT /users/1.json
  50. def update
  51. @user = User.find(params[:id])
  52. respond_to do |format|
  53. if @user.update_attributes(params[:user])
  54. format.html { redirect_to @user, notice: 'User was successfully updated.' }
  55. format.json { head :no_content }
  56. else
  57. format.html { render action: "edit" }
  58. format.json { render json: @user.errors, status: :unprocessable_entity }
  59. end
  60. end
  61. end
  62. # DELETE /users/1
  63. # DELETE /users/1.json
  64. # def destroy
  65. # @user = User.find(params[:id])
  66. # @user.destroy
  67. #
  68. # respond_to do |format|
  69. # format.html { redirect_to users_url }
  70. # format.json { head :no_content }
  71. # end
  72. # end
  73. end