GeoRSS aggregator and Layar augmented reality server
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. @feed = Feed.new
  16. @feed.new_layer_id = @layer.id
  17. respond_to do |format|
  18. format.html # show.html.erb
  19. format.json { render json: @layer }
  20. end
  21. end
  22. # GET /layers/new
  23. # GET /layers/new.json
  24. def new
  25. @layer = Layer.new
  26. respond_to do |format|
  27. format.html # new.html.erb
  28. format.json { render json: @layer }
  29. end
  30. end
  31. # GET /layers/1/edit
  32. def edit
  33. @layer = Layer.find(params[:id])
  34. end
  35. # POST /layers
  36. # POST /layers.json
  37. def create
  38. @layer = Layer.new(params[:layer])
  39. respond_to do |format|
  40. if @layer.save
  41. format.html { redirect_to @layer, notice: 'Layer was successfully created.' }
  42. format.json { render json: @layer, status: :created, location: @layer }
  43. else
  44. format.html { render action: "new" }
  45. format.json { render json: @layer.errors, status: :unprocessable_entity }
  46. end
  47. end
  48. end
  49. # PUT /layers/1
  50. # PUT /layers/1.json
  51. def update
  52. @layer = Layer.find(params[:id])
  53. respond_to do |format|
  54. if @layer.update_attributes(params[:layer])
  55. format.html { redirect_to @layer, notice: 'Layer was successfully updated.' }
  56. format.json { head :no_content }
  57. else
  58. format.html { render action: "edit" }
  59. format.json { render json: @layer.errors, status: :unprocessable_entity }
  60. end
  61. end
  62. end
  63. # DELETE /layers/1
  64. # DELETE /layers/1.json
  65. def destroy
  66. @layer = Layer.find(params[:id])
  67. @layer.destroy
  68. respond_to do |format|
  69. format.html { redirect_to layers_url }
  70. format.json { head :no_content }
  71. end
  72. end
  73. end