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.

layers_controller.rb 1.9 KiB

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