public
Description: Small application that lets you generate an rss feed for any page
Clone URL: git://github.com/jduff/rssanything.git
Search Repo:
better error handling on feeds/show, doesn't throw a 500 now
John Duff (author)
Wed May 14 19:40:51 -0700 2008
commit  1c8d151140f9170ab9b89f29f67cae7139c75b01
tree    decf0b316c615081f0510071ce6a62b3317808f5
parent  3c21f9b2c72a3331e266567746278014b906c6b2
...
20
21
22
 
 
23
24
25
...
28
29
30
 
 
 
 
 
31
32
...
20
21
22
23
24
25
26
27
...
30
31
32
33
34
35
36
37
38
39
0
@@ -20,6 +20,8 @@
0
   def show
0
     @feed = Feed.find_by_id(params[:id])
0
     
0
+ return redirect_and_flash({:action => :index}, "That feed could not be found") unless @feed
0
+
0
     @items = Item.find(:all, :conditions => ["feed_id = ?", params[:id]],
0
       :order => "created_at DESC")
0
     
0
@@ -28,6 +30,11 @@
0
     end
0
   end
0
   
0
+ private
0
+ def redirect_and_flash(url, message, severity = :error)
0
+ flash[severity] = message
0
+ redirect_to url
0
+ end
0
   
0
 end

Comments

    No one has commented yet.