Class: RssFeedsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RssFeedsController
- Defined in:
- app/controllers/rss_feeds_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /rss_feeds POST /rss_feeds.xml.
-
#destroy ⇒ Object
DELETE /rss_feeds/1 DELETE /rss_feeds/1.xml.
-
#edit ⇒ Object
GET /rss_feeds/1/edit.
-
#index ⇒ Object
GET /rss_feeds GET /rss_feeds.xml.
-
#new ⇒ Object
GET /rss_feeds/new GET /rss_feeds/new.xml.
-
#show ⇒ Object
GET /rss_feeds/1 GET /rss_feeds/1.xml.
-
#update ⇒ Object
PUT /rss_feeds/1 PUT /rss_feeds/1.xml.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
POST /rss_feeds POST /rss_feeds.xml
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/rss_feeds_controller.rb', line 44 def create @rss_feed = RssFeed.new(params[:rss_feed]) respond_to do |format| if @rss_feed.save flash[:notice] = 'RssFeed was successfully created.' format.html { redirect_to(@rss_feed) } format.xml { render :xml => @rss_feed, :status => :created, :location => @rss_feed } else format.html { render :action => "new" } format.xml { render :xml => @rss_feed.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /rss_feeds/1 DELETE /rss_feeds/1.xml
78 79 80 81 82 83 84 85 86 |
# File 'app/controllers/rss_feeds_controller.rb', line 78 def destroy @rss_feed = RssFeed.find(params[:id]) @rss_feed.destroy respond_to do |format| format.html { redirect_to(rss_feeds_url) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /rss_feeds/1/edit
38 39 40 |
# File 'app/controllers/rss_feeds_controller.rb', line 38 def edit @rss_feed = RssFeed.find(params[:id]) end |
#index ⇒ Object
GET /rss_feeds GET /rss_feeds.xml
6 7 8 9 10 11 12 13 |
# File 'app/controllers/rss_feeds_controller.rb', line 6 def index @rss_feeds = RssFeed.all puts "hello world" respond_to do |format| format.html # index.html.erb format.xml { render :xml => @rss_feeds } end end |
#new ⇒ Object
GET /rss_feeds/new GET /rss_feeds/new.xml
28 29 30 31 32 33 34 35 |
# File 'app/controllers/rss_feeds_controller.rb', line 28 def new @rss_feed = RssFeed.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @rss_feed } end end |
#show ⇒ Object
GET /rss_feeds/1 GET /rss_feeds/1.xml
17 18 19 20 21 22 23 24 |
# File 'app/controllers/rss_feeds_controller.rb', line 17 def show @rss_feed = RssFeed.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @rss_feed } end end |
#update ⇒ Object
PUT /rss_feeds/1 PUT /rss_feeds/1.xml
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/controllers/rss_feeds_controller.rb', line 61 def update @rss_feed = RssFeed.find(params[:id]) respond_to do |format| if @rss_feed.update_attributes(params[:rss_feed]) flash[:notice] = 'RssFeed was successfully updated.' format.html { redirect_to(@rss_feed) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @rss_feed.errors, :status => :unprocessable_entity } end end end |