projects
/
feedcatcher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3a164c4
)
Merged changes into stable branch
author
Neil Smith
<neil.git@njae.me.uk>
Wed, 22 Jul 2009 14:35:20 +0000
(14:35 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Wed, 22 Jul 2009 14:35:20 +0000
(14:35 +0000)
app/controllers/feed_controller.rb
patch
|
blob
|
history
app/views/feed/index.html.erb
patch
|
blob
|
history
app/views/feed/index.rss.builder
patch
|
blob
|
history
app/views/feed/show.html.erb
patch
|
blob
|
history
app/views/feed/show.rss.builder
patch
|
blob
|
history
config/routes.rb
patch
|
blob
|
history
diff --git
a/app/controllers/feed_controller.rb
b/app/controllers/feed_controller.rb
index 2d6fee9786f62166fb4414cef8fa241c67c7f96c..30ddb0c6668cfdbe1bc12cfd26fd93ca15492de2 100644
(file)
--- a/
app/controllers/feed_controller.rb
+++ b/
app/controllers/feed_controller.rb
@@
-36,8
+36,8
@@
class FeedController < ApplicationController
def update
def update
- if valid_feed_name?(params[:
new_
feed_name])
- item = FeedItem.find_by_feed_name_and_title(params[:
new_
feed_name], params[:title])
+ if valid_feed_name?(params[:feed_name])
+ item = FeedItem.find_by_feed_name_and_title(params[:feed_name], params[:title])
if item
if params[:description] == ''
destroy_item(item)
if item
if params[:description] == ''
destroy_item(item)
@@
-70,19
+70,19
@@
class FeedController < ApplicationController
def create_item
def create_item
- item = FeedItem.new(:feed_name => params[:
new_
feed_name],
+ item = FeedItem.new(:feed_name => params[:feed_name],
:title => params[:title],
:description => params[:description])
item.save!
flash[:notice] = "Element #{params[:title]} created"
respond_to do |format|
:title => params[:title],
:description => params[:description])
item.save!
flash[:notice] = "Element #{params[:title]} created"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :ok }
end
rescue ActiveRecord::RecordInvalid => error
flash[:notice] = "Element #{params[:title]} could not be created"
respond_to do |format|
format.rss { head :ok }
end
rescue ActiveRecord::RecordInvalid => error
flash[:notice] = "Element #{params[:title]} could not be created"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :unprocessable_entity }
end
end
format.rss { head :unprocessable_entity }
end
end
@@
-92,13
+92,13
@@
class FeedController < ApplicationController
if item.update_attribute(:description, params[:description])
flash[:notice] = "Element #{params[:title]} updated"
respond_to do |format|
if item.update_attribute(:description, params[:description])
flash[:notice] = "Element #{params[:title]} updated"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :ok }
end
else
flash[:notice] = "Element #{params[:title]} could not be updated"
respond_to do |format|
format.rss { head :ok }
end
else
flash[:notice] = "Element #{params[:title]} could not be updated"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :unprocessable_entity }
end
end
format.rss { head :unprocessable_entity }
end
end
@@
-109,13
+109,13
@@
class FeedController < ApplicationController
if item.destroy
flash[:notice] = "Element #{params[:title]} destroyed"
respond_to do |format|
if item.destroy
flash[:notice] = "Element #{params[:title]} destroyed"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :ok }
end
else
flash[:notice] = "Element #{params[:title]} could not be destroyed"
respond_to do |format|
format.rss { head :ok }
end
else
flash[:notice] = "Element #{params[:title]} could not be destroyed"
respond_to do |format|
- format.html { redirect_to feed_url(params[:
new_
feed_name]) }
+ format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :unprocessable_entity }
end
end
format.rss { head :unprocessable_entity }
end
end
diff --git
a/app/views/feed/index.html.erb
b/app/views/feed/index.html.erb
index 1a6534bccacfe37d3203d18d5b7e1c48e3c35a88..8b2e8c18e9f98ce3a8f0436b4c1099f893730f28 100644
(file)
--- a/
app/views/feed/index.html.erb
+++ b/
app/views/feed/index.html.erb
@@
-1,7
+1,7
@@
<h1>Feeds available</h1>
<% form_tag :action => 'update' do %>
<h1>Feeds available</h1>
<% form_tag :action => 'update' do %>
- <p>Set feed <%= text_field_tag :
new_
feed_name, '', :size => 20 %>
+ <p>Set feed <%= text_field_tag :feed_name, '', :size => 20 %>
to include <%= text_field_tag :title, '', :size => 30 %>
containing <%= text_field_tag :description, '', :size => 50 %>
<%= submit_tag 'Update' %></p>
to include <%= text_field_tag :title, '', :size => 30 %>
containing <%= text_field_tag :description, '', :size => 50 %>
<%= submit_tag 'Update' %></p>
diff --git
a/app/views/feed/index.rss.builder
b/app/views/feed/index.rss.builder
index 93ce050e2316394c7407d432c013b443e676d111..a122ec0452a115ca006e85b146ffc2e584f48bb4 100644
(file)
--- a/
app/views/feed/index.rss.builder
+++ b/
app/views/feed/index.rss.builder
@@
-3,8
+3,8
@@
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title "Feedcatcher"
xml.rss :version => "2.0" do
xml.channel do
xml.title "Feedcatcher"
- xml.description "Feeds available"
xml.link index_url(:rss)
xml.link index_url(:rss)
+ xml.description "Feeds available"
for feed in @feeds
xml.item do
for feed in @feeds
xml.item do
diff --git
a/app/views/feed/show.html.erb
b/app/views/feed/show.html.erb
index 739584cda210b9f511d97ef9ef0ef7a16f195792..2a2b9b1daaaad4094886073444761803d9270618 100644
(file)
--- a/
app/views/feed/show.html.erb
+++ b/
app/views/feed/show.html.erb
@@
-2,7
+2,7
@@
<p><%= link_to("List of all feeds", index_url) %></p>
<% form_tag :action => 'update' do %>
<p><%= link_to("List of all feeds", index_url) %></p>
<% form_tag :action => 'update' do %>
- <p>Set feed <%= text_field_tag :
new_
feed_name, h(params[:feed_name]), :size => 20 %>
+ <p>Set feed <%= text_field_tag :feed_name, h(params[:feed_name]), :size => 20 %>
to include <%= text_field_tag :title, '', :size => 30 %>
containing <%= text_field_tag :description, '', :size => 50 %>
<%= submit_tag 'Update' %></p>
to include <%= text_field_tag :title, '', :size => 30 %>
containing <%= text_field_tag :description, '', :size => 50 %>
<%= submit_tag 'Update' %></p>
diff --git
a/app/views/feed/show.rss.builder
b/app/views/feed/show.rss.builder
index 7fdfe205b8f2afe4094a5b4ae6e535c26370aff0..dd8f41de987a565845f6abb9836d96ff8d74c1d4 100644
(file)
--- a/
app/views/feed/show.rss.builder
+++ b/
app/views/feed/show.rss.builder
@@
-1,9
+1,10
@@
-#
index
.rss.builder
+#
show
.rss.builder
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title @feed_name
xml.link feed_url(@feed_name, :rss)
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title @feed_name
xml.link feed_url(@feed_name, :rss)
+ xml.description "The #{h @feed_name} feed"
for item in @feed_items
xml.item do
for item in @feed_items
xml.item do
diff --git
a/config/routes.rb
b/config/routes.rb
index 7754dd1c3cfa886b5ed17c33e10ac332d87816e2..1240ec454b96f800e8a3dcfff658bd9159767a21 100644
(file)
--- a/
config/routes.rb
+++ b/
config/routes.rb
@@
-38,9
+38,9
@@
ActionController::Routing::Routes.draw do |map|
:conditions => { :method => :get },
:controller => 'feed',
:action => 'show'
:conditions => { :method => :get },
:controller => 'feed',
:action => 'show'
- map.update ':
feed_name
',
+ map.update ':
ignored
',
:conditions => { :method => :post },
:conditions => { :method => :post },
- :defaults => { :
feed_name
=> nil },
+ :defaults => { :
ignored
=> nil },
:controller => 'feed',
:action => 'update'
:controller => 'feed',
:action => 'update'