Sha256: b859788d6183d291170b56cf70a5572c8f84f503fc60d7f9b17a578c5abcb9c3
Contents?: true
Size: 1.69 KB
Versions: 2
Compression:
Stored size: 1.69 KB
Contents
class Recommender::FeedsController < ApplicationController def create @feed = Feed.new(params[:feed]) @feed.harvested_from_display_uri = @feed.display_uri @feed.entries_count = 0 @feed.last_requested_at = Time.now - 2592000 @feed.last_harvested_at = Time.now - 2592000 respond_to do |format| if @feed.save flash[:notice] = 'Feed was successfully created.' # email the admin to let them know a feed has been added # notification_feed_added(@feed) # redirect to a page letting them know the feed has been created #format.html { redirect_to entries_path(@feed) + "?new_feed=true" } format.html { redirect_to "/feeds/" } format.xml { head :created, :location => feed_url(@feed) } else format.html { render :action => "new" } format.xml { render :xml => @feed.errors.to_xml } end end end # PUT /feeds/1 # PUT /feeds/1.xml def update @feed = Feed.find(params[:id]) # force a harvest now # harvest_now respond_to do |format| if @feed.update_attributes(params[:feed]) # notification_feed_updated(@feed) flash[:notice] = 'Feed was successfully updated.' format.html { redirect_to "/feeds/" return } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @feed.errors.to_xml } end end end # DELETE /feeds/1 # DELETE /feeds/1.xml def destroy @feed = Feed.find(params[:id]) @feed.destroy respond_to do |format| format.html { redirect_to feeds_url } format.xml { head :ok } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
muck-raker-0.1.14 | app/controllers/recommender/feeds_controller.rb |
muck-raker-0.1.15 | app/controllers/recommender/feeds_controller.rb |