diff --git a/app/controllers/beers_controller.rb b/app/controllers/beers_controller.rb
index 62823bb..44279a9 100644
--- a/app/controllers/beers_controller.rb
+++ b/app/controllers/beers_controller.rb
@@ -5,16 +5,21 @@ class BeersController < ApplicationController
# GET /beers
# GET /beers.xml
def index
- @content_title = 'The Beers'
- @secondary_title = 'Browsing all beers'
- @pages, @beers = paginate :beers, :include => 'page', :per_page => per_page,
- :order => 'beers.title ASC'
- flash.now[:notice] = 'There are no beers yet.' if @beers.empty?
- @tags = Page.tags(:limit => 25, :order => "name DESC",
- :owner_type => 'Beer')
respond_to do |format|
- format.html # index.rhtml
- format.xml { render :xml => @beers.to_xml }
+ format.html do
+ @content_title = 'The Beers'
+ @secondary_title = 'Browsing all beers'
+ @pages, @beers = paginate :beers, :include => 'page', :per_page => per_page,
+ :order => 'beers.title ASC'
+ flash.now[:notice] = 'There are no beers yet.' if @beers.empty?
+ @tags = Page.tags(:limit => 25, :order => "name DESC",
+ :owner_type => 'Beer')
+ end
+ format.rss do
+ @beers = Beer.find :all, :order => 'beers.created_at DESC',
+ :limit => per_page
+ render :partial => 'beers'
+ end
end
end
diff --git a/app/controllers/breweries_controller.rb b/app/controllers/breweries_controller.rb
index 3c24d90..b7fcb8d 100644
--- a/app/controllers/breweries_controller.rb
+++ b/app/controllers/breweries_controller.rb
@@ -5,18 +5,21 @@ class BreweriesController < ApplicationController
# GET /breweries
# GET /breweries.xml
def index
- @content_title = 'The Breweries'
- @secondary_title = 'Browsing all breweries'
- @pages, @breweries = paginate :breweries, :include => 'page',
- :order => 'breweries.title ASC', :per_page => per_page
- if @breweries.empty?
- flash.now[:notice] = 'There are no breweries yet.'
- end
- @tags = Page.tags(:limit => 25, :order => "name DESC",
- :owner_type => 'Beer')
respond_to do |format|
- format.html # index.rhtml
- format.xml { render :xml => @breweries.to_xml }
+ format.html do
+ @content_title = 'The Breweries'
+ @secondary_title = 'Browsing all breweries'
+ @pages, @breweries = paginate :breweries, :include => 'page',
+ :order => 'breweries.title ASC', :per_page => per_page
+ flash.now[:notice] = 'There are no breweries yet.' if @breweries.empty?
+ @tags = Page.tags(:limit => 25, :order => "name DESC",
+ :owner_type => 'Beer')
+ end
+ format.rss do
+ @breweries = Brewery.find :all, :order => 'breweries.created_at DESC',
+ :limit => per_page
+ render :partial => 'breweries'
+ end
end
end
diff --git a/app/controllers/discussions_controller.rb b/app/controllers/discussions_controller.rb
index 8252501..4a7d123 100644
--- a/app/controllers/discussions_controller.rb
+++ b/app/controllers/discussions_controller.rb
@@ -11,7 +11,7 @@ class DiscussionsController < ApplicationController
:conditions => [ 'allow_discussions = ?', true ], :per_page => per_page,
:include => [ 'discussions' ]
respond_to do |format|
- format.html # index.rhtml
+ format.html
end
end
@@ -23,8 +23,8 @@ class DiscussionsController < ApplicationController
@pages, @discussions = paginate :discussion, :order => 'created_at ASC',
:conditions => [ 'page_id = ?', @page.id ], :per_page => per_page
respond_to do |format|
- format.html # show.rhtml
- format.xml { render :xml => @discussions.to_xml }
+ format.html
+ format.rss { render :partial => 'discussions' }
end
end
diff --git a/app/controllers/experiences_controller.rb b/app/controllers/experiences_controller.rb
index 7e926dd..c5eab6d 100644
--- a/app/controllers/experiences_controller.rb
+++ b/app/controllers/experiences_controller.rb
@@ -26,7 +26,7 @@ class ExperiencesController < ApplicationController
end
format.rss do
@experiences = @people.experiences.find :all, :limit => per_page,
- :order => 'created_at DESC'
+ :order => 'experiences.created_at DESC'
render :partial => 'experiences'
end
end
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index b8165c8..24e2e4d 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -5,21 +5,24 @@ class PagesController < ApplicationController
# GET /pages
# GET /pages.xml
def index
- @page = Page.find_by_title_and_owner_type 'HomePage', nil
- @page ||= Page.create :title => 'HomePage',
- :redcloth => 'Welcome to BarleySodas!'
- @content_title = 'The Beer Wiki'
- @secondary_title = 'Browsing all pages'
-
- cond_ary = [ 'owner_id IS NULL' ]
- cond_ary << "title <> 'HomePage'"
- @pages, @wiki_pages = paginate :page, :per_page => per_page,
- :order => 'title ASC', :conditions => [ cond_ary.join(' AND ') ]
-
- @tags = Page.tags(:limit => 25, :order => "name ASC")
-
respond_to do |format|
- format.html # index.rhtml
+ format.html do
+ @page = Page.find_by_title_and_owner_type 'HomePage', nil
+ @page ||= Page.create :title => 'HomePage',
+ :redcloth => 'Welcome to BarleySodas!'
+ @content_title = 'The Beer Wiki'
+ @secondary_title = 'Browsing all pages'
+ cond_ary = [ 'owner_id IS NULL' ]
+ cond_ary << "title <> 'HomePage'"
+ @pages, @wiki_pages = paginate :page, :per_page => per_page,
+ :order => 'title ASC', :conditions => [ cond_ary.join(' AND ') ]
+ @tags = Page.tags(:limit => 25, :order => "name ASC")
+ end
+ format.rss do
+ @pages = Page.find :all, :order => 'updated_at DESC',
+ :limit => per_page, :conditions => [ 'owner_type IS NULL' ]
+ render :partial => 'pages'
+ end
end
end
diff --git a/app/controllers/peoples_controller.rb b/app/controllers/peoples_controller.rb
index f502410..c955f1c 100644
--- a/app/controllers/peoples_controller.rb
+++ b/app/controllers/peoples_controller.rb
@@ -5,14 +5,19 @@ class PeoplesController < ApplicationController
# GET /peoples
# GET /peoples.xml
def index
- @secondary_title = 'Browsing all Peoples'
- @pages, @peoples = paginate :people, :per_page => per_page,
- :order => 'title ASC', :singular_name => 'people'
- @tags = Page.tags(:limit => 25, :order => "name DESC",
- :owner_type => 'People')
respond_to do |format|
- format.html # index.rhtml
- format.xml { render :xml => @people.to_xml }
+ format.html do
+ @secondary_title = 'Browsing all Peoples'
+ @pages, @peoples = paginate :people, :per_page => per_page,
+ :order => 'title ASC', :singular_name => 'people'
+ @tags = Page.tags(:limit => 25, :order => "name DESC",
+ :owner_type => 'People')
+ end
+ format.rss do
+ @peoples = People.find :all, :order => 'peoples.created_at DESC',
+ :limit => per_page
+ render :partial => 'peoples'
+ end
end
end
diff --git a/app/views/beers/_beers.rxml b/app/views/beers/_beers.rxml
new file mode 100644
index 0000000..b1b0c9c
--- /dev/null
+++ b/app/views/beers/_beers.rxml
@@ -0,0 +1,20 @@
+xml.instruct! :xml, :version=>"1.0"
+xml.rss(:version=>"2.0"){
+ xml.channel{
+ xml.title("BarleySodas Newest Beers")
+ xml.link(beers_url)
+ xml.description("The newest experience points added into BarleySodas.")
+ xml.lastBuildDate((@beers.first.created_at.strftime("%a, %d %b %Y %H:%M:%S %z") rescue nil))
+ xml.language('en-us')
+ for beer in @beers
+ xml.item do
+ xml.title(beer.title)
+ xml.description(beer.brewery.title)
+ xml.author(beer.page.created_by.title)
+ xml.pubDate(beer.created_at.strftime("%a, %d %b %Y %H:%M:%S %z"))
+ xml.link(beer_url(beer.page.title_for_url))
+ xml.guid(beer_url(beer.page.title_for_url))
+ end
+ end
+ }
+}
\ No newline at end of file
diff --git a/app/views/beers/index.rhtml b/app/views/beers/index.rhtml
index bc94949..fb61ea3 100644
--- a/app/views/beers/index.rhtml
+++ b/app/views/beers/index.rhtml
@@ -8,3 +8,7 @@
<%= link_to "New Beer", new_beer_path, { :title => 'Create a new beer' } -%>
<%= render :partial => 'shared/tag_cloud' %>
<% end -%>
+
+<% content_for :auto_discoveries do -%>
+ <%= auto_discovery_link_tag :rss, { :format => :rss } %>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/breweries/_breweries.rxml b/app/views/breweries/_breweries.rxml
new file mode 100644
index 0000000..e2e52a3
--- /dev/null
+++ b/app/views/breweries/_breweries.rxml
@@ -0,0 +1,20 @@
+xml.instruct! :xml, :version=>"1.0"
+xml.rss(:version=>"2.0"){
+ xml.channel{
+ xml.title("BarleySodas Newest Breweries")
+ xml.link(breweries_url)
+ xml.description("The newest breweries added into BarleySodas.")
+ xml.lastBuildDate((@breweries.first.created_at.strftime("%a, %d %b %Y %H:%M:%S %z") rescue nil))
+ xml.language('en-us')
+ for brewery in @breweries
+ xml.item do
+ xml.title(brewery.title)
+ xml.description(brewery.homepage)
+ xml.author(brewery.page.created_by.title)
+ xml.pubDate(brewery.created_at.strftime("%a, %d %b %Y %H:%M:%S %z"))
+ xml.link(brewery_url(brewery.page.title_for_url))
+ xml.guid(brewery_url(brewery.page.title_for_url))
+ end
+ end
+ }
+}
\ No newline at end of file
diff --git a/app/views/breweries/index.rhtml b/app/views/breweries/index.rhtml
index b52df6d..fad4bb8 100644
--- a/app/views/breweries/index.rhtml
+++ b/app/views/breweries/index.rhtml
@@ -8,3 +8,7 @@
<%= link_to 'New brewery', new_brewery_path -%>
<%= render :partial => 'shared/tag_cloud' %>
<% end -%>
+
+<% content_for :auto_discoveries do -%>
+ <%= auto_discovery_link_tag :rss, { :format => :rss } %>
+<% end -%>
\ No newline at end of file
diff --git a/app/views/discussions/_discussions.rxml b/app/views/discussions/_discussions.rxml
new file mode 100644
index 0000000..10afafb
--- /dev/null
+++ b/app/views/discussions/_discussions.rxml
@@ -0,0 +1,20 @@
+xml.instruct! :xml, :version=>"1.0"
+xml.rss(:version=>"2.0"){
+ xml.channel{
+ xml.title("Discussion Thread for #{@page.title}")
+ xml.link(discussion_url(@page))
+ xml.description("All posts in the thread.")
+ xml.language('en-us')
+ xml.lastBuildDate((@discussions.last.created_at.strftime("%a, %d %b %Y %H:%M:%S %z") rescue nil))
+ for discussion in @discussions
+ xml.item do
+ xml.title("Item posted at #{discussion.created_at}")
+ xml.description(discussion.text)
+ xml.author("Unknown, right now.")
+ xml.pubDate(discussion.created_at.strftime("%a, %d %b %Y %H:%M:%S %z"))
+ xml.link(discussion_url(@page))
+ xml.guid(discussion_url(@page))
+ end
+ end
+ }
+}
\ No newline at end of file
diff --git a/app/views/discussions/show.rhtml b/app/views/discussions/show.rhtml
index 3bdf125..11d7261 100644
--- a/app/views/discussions/show.rhtml
+++ b/app/views/discussions/show.rhtml
@@ -12,4 +12,8 @@
<% content_for 'sidebar' do -%>
<%= page_or_parent_link(@page) -%>
+<% end -%>
+
+<% content_for :auto_discoveries do -%>
+ <%= auto_discovery_link_tag :rss, { :format => :rss } %>
<% end -%>
\ No newline at end of file
diff --git a/app/views/experiences/_experiences.rhtml b/app/views/experiences/_experiences.rhtml
deleted file mode 100644
index 6a28e53..0000000
--- a/app/views/experiences/_experiences.rhtml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-