Sha256: 352ed882672505e4f7185568df4b9f041ebd8dfb0c414a2a8939d57de493019f
Contents?: true
Size: 1.18 KB
Versions: 8
Compression:
Stored size: 1.18 KB
Contents
class TrackbacksController < FeedbackController def create @error_message = catch(:error) do if this_blog.global_pings_disable throw :error, "Trackback not saved" elsif params[:__mode] == 'rss' # Part of the trackback spec... not sure what we should be doing here though. else begin @trackback = this_blog.ping_article!( params.merge(:ip => request.remote_ip, :published => true)) "" rescue ActiveRecord::RecordNotFound, ActiveRecord::StatementInvalid throw :error, "Article id #{params[:id]} not found." rescue ActiveRecord::RecordInvalid throw :error, "Trackback not saved" end end end respond_to do |format| format.xml { render :action => 'trackback.xml.builder' } format.html { render :nothing => true } end end protected def get_feedback @trackbacks = if params[:article_id] Article.find(params[:article_id]).published_trackbacks else Trackback.find_published(:all, this_blog.rss_limit_params.merge(:order => 'created_at DESC')) end end def get_article true end end
Version data entries
8 entries across 8 versions & 1 rubygems