Make the importer even more robust and add a delete button

This commit is contained in:
Aaron Mueller 2013-01-10 21:34:08 +01:00
parent 04fa99b1f8
commit c24799fed2
3 changed files with 7 additions and 5 deletions

View file

@ -1,12 +1,12 @@
class FeedsController < ApplicationController
# Show all feeds
def index
@feeds = Feed.all
@feeds = Feed.order("title").all
end
# Show a single feed
def show
@items = Feed.find(params[:id]).items
@feed = Feed.find(params[:id])
render :layout => false
end
@ -26,7 +26,7 @@ class FeedsController < ApplicationController
end
def import
fh = File.open(Rails.root.join("public", "uploads", params[:importer][:import_file].original_filename))
#fh = File.open(Rails.root.join("public", "uploads", params[:importer][:import_file].original_filename))
# TODO: Hier gehts weiter
end
end

View file

@ -14,7 +14,7 @@ class Item < ActiveRecord::Base
:title => feed_entry.title,
:url => feed_entry.url,
:author => feed_entry.author || "Anonymous",
:published_at => feed_entry.published,
:published_at => feed_entry.published || Time.now,
:content => feed_entry.content || feed_entry.summary || "No content available"
)
end

View file

@ -1,5 +1,7 @@
<h3><%= link_to(@feed.url, @feed.url) %></h3>
<ul>
<% @items.each do |item| %>
<% @feed.items.each do |item| %>
<li class="item">
<%= link_to raw(item.title), item_path(item), :remote => true %>
<em class="date_published"><%= time_ago_in_words(item.published_at) %></em> <em class="author">by <%= item.author %></em>