projects
/
feedcatcher.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merging changes from trunk into stable branch
[feedcatcher.git]
/
app
/
controllers
/
feed_controller.rb
diff --git
a/app/controllers/feed_controller.rb
b/app/controllers/feed_controller.rb
index 30ddb0c6668cfdbe1bc12cfd26fd93ca15492de2..819dab13c0dd344c376e38f73d544ba9a2fea61e 100644
(file)
--- a/
app/controllers/feed_controller.rb
+++ b/
app/controllers/feed_controller.rb
@@
-12,7
+12,7
@@
class FeedController < ApplicationController
def show
def show
- if valid_feed_name?(params[:feed_name])
+ if
FeedItem::
valid_feed_name?(params[:feed_name])
@feed_items = FeedItem.find_all_by_feed_name(params[:feed_name])
@feed_name = params[:feed_name]
respond_to do |format|
@feed_items = FeedItem.find_all_by_feed_name(params[:feed_name])
@feed_name = params[:feed_name]
respond_to do |format|
@@
-36,7
+36,7
@@
class FeedController < ApplicationController
def update
def update
- if valid_feed_name?(params[:feed_name])
+ if
FeedItem::
valid_feed_name?(params[:feed_name])
item = FeedItem.find_by_feed_name_and_title(params[:feed_name], params[:title])
if item
if params[:description] == ''
item = FeedItem.find_by_feed_name_and_title(params[:feed_name], params[:title])
if item
if params[:description] == ''
@@
-59,15
+59,6
@@
class FeedController < ApplicationController
private
private
- def valid_feed_name?(feed_name)
- Rack::Utils::escape(feed_name) == feed_name and
- Rack::Utils::unescape(feed_name) == feed_name and
- feed_name != 'index' and
- feed_name != 'show' and
- feed_name != 'update' and
- feed_name != 'action'
- end
-
def create_item
item = FeedItem.new(:feed_name => params[:feed_name],
def create_item
item = FeedItem.new(:feed_name => params[:feed_name],
@@
-107,13
+98,13
@@
class FeedController < ApplicationController
def destroy_item(item)
if item.destroy
def destroy_item(item)
if item.destroy
- flash[:notice] = "Element #{params[:title]} de
stroy
ed"
+ flash[:notice] = "Element #{params[:title]} de
let
ed"
respond_to do |format|
format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :ok }
end
else
respond_to do |format|
format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :ok }
end
else
- flash[:notice] = "Element #{params[:title]} could not be de
stroy
ed"
+ flash[:notice] = "Element #{params[:title]} could not be de
let
ed"
respond_to do |format|
format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :unprocessable_entity }
respond_to do |format|
format.html { redirect_to feed_url(params[:feed_name]) }
format.rss { head :unprocessable_entity }