GeoRSS aggregator and Layar augmented reality server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

86 lines
1.9 KiB

  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