GeoRSS aggregator and Layar augmented reality server
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

feeds_controller.rb 1.9 KiB

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