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)
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|
- 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.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
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.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
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.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
<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>
<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>
:conditions => { :method => :get },
:controller => 'feed',
:action => 'show'
- map.update ':feed_name',
+ map.update ':ignored',
:conditions => { :method => :post },
- :defaults => { :feed_name => nil },
+ :defaults => { :ignored => nil },
:controller => 'feed',
:action => 'update'