GeoRSS aggregator and Layar augmented reality server
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

users_controller.rb 1.9 KiB

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