File tree 1 file changed +26
-0
lines changed
vendor/plugins/tutorials/app/views/tutorials
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ xml . instruct! :xml , :version => "1.0"
2
+ xml . rss :version => "2.0" , "xmlns:atom" => "http://www.w3.org/2005/Atom" do
3
+ xml . channel do
4
+ # Required to pass W3C validation.
5
+ xml . atom :link , nil , {
6
+ :href => tutorials_url ( :format => 'rss' ) ,
7
+ :rel => 'self' , :type => 'application/rss+xml'
8
+ }
9
+
10
+ # Feed basics.
11
+ xml . title page_title
12
+ xml . description @page [ :body ] . to_s . gsub ( /<\/ ?[^>]*>/ , "" ) # .to_s protects from nil errors
13
+ xml . link tutorials_url ( :format => 'rss' )
14
+
15
+ # News items.
16
+ @tutorials . each do |tutorial |
17
+ xml . item do
18
+ xml . title tutorial . title
19
+ xml . link tutorial_url ( tutorial )
20
+ xml . description truncate ( tutorial . content , :length => 200 , :preserve_html_tags => true )
21
+ xml . pubDate tutorial . updated_at . to_s ( :rfc822 )
22
+ xml . guid tutorial_url ( tutorial )
23
+ end
24
+ end
25
+ end
26
+ end
You can’t perform that action at this time.
0 commit comments