21 lines
376 B
Ruby
21 lines
376 B
Ruby
class FeedsController < ApplicationController
|
|
# Show all feeds
|
|
def index
|
|
@feeds = Feed.all
|
|
end
|
|
|
|
# Show a single feed
|
|
def show
|
|
@items = Feed.find(params[:id]).items
|
|
end
|
|
|
|
def load_item
|
|
@item = Item.find(params[:id])
|
|
end
|
|
|
|
def create
|
|
@feed = Feed.import(params[:feed][:url])
|
|
redirect_to :action => :index, :notice => "Add the feed"
|
|
end
|
|
end
|