Created
September 7, 2012 16:35
-
-
Save tacoman667/3667625 to your computer and use it in GitHub Desktop.
what the...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
@asset = Slide.active.order("position") | |
url = 'http://www.example.com/feed' | |
open(url) do |rss| | |
rss_feed = RSS::Parser.parse(rss) | |
rss_feed.items.first do |item| | |
logger.info item | |
@feed = BlogFeed.new(title: item.title, link: item.link, date: item.pubDate, author: item.author, description: item.description) | |
end | |
end | |
begin | |
@weeklymessage = WeeklyMessage.find(1) | |
rescue ActiveRecord::RecordNotFound | |
@weeklymessage = WeeklyMessage.new | |
end | |
render :layout => 'home' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row-fluid"> | |
<div class="span12"> | |
<div class="featured-blog"> | |
<div class="row"> | |
<div class="span7 offset5 blogz"> | |
<h2><%= @feed.title %></h2> | |
<p><%= @feed.description %></p> | |
<p class="author">Most recent post from <%= @feed.author %> / <%= @feed.date.to_date.strftime('%m.%d.%y') %></p> | |
<a class="blog-link" href="<%= @feed.link %>">Continue Reading</a> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment