Skip to content

Commit 8a170ca

Browse files
author
Marylou Lenhart
committed
Temporary first Commit
1 parent b85a580 commit 8a170ca

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

app/controllers/questions_controller.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,13 @@ def set_presenter
6565
end
6666
end
6767

68+
def feed
69+
@questions = @question.all(:select => "title, description, solution_id, created_at", :order => "created_at DESC", :limit => 20)
70+
71+
respond_to do |format|
72+
format.html
73+
format.rss { render :layout => false }
74+
end
75+
end
76+
6877
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
xml.instruct! :xml, :version => "1.0"
2+
xml.rss :version => "2.0" do
3+
xml.channel do
4+
xml.title "Questions"
5+
xml.link questions_url
6+
7+
for question in @questions
8+
xml.item do
9+
xml.title question.title
10+
xml.description question.description
11+
xml.pubDate question.created_at.to_s(:rfc822)
12+
xml.link questions_url(question)
13+
xml.guid questions_url(question)
14+
end
15+
end
16+
end
17+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
%section.support
22
%h2 Support
33
%p Having a problem running Hackety Hack? Found a bug? Check out the #{link_to "support section", support_questions_path}
4+
5+
%a.href auto_discovery_link_tag(:rss, questions_url)

0 commit comments

Comments
 (0)