Skip to content

Instantly share code, notes, and snippets.

@dokipen
Created February 1, 2011 17:01
Show Gist options
  • Save dokipen/806155 to your computer and use it in GitHub Desktop.
Save dokipen/806155 to your computer and use it in GitHub Desktop.
Index Controller
class Index
def get
@articles = []
Article::find(:all, :order => 'id').each do |a|
preview_row = Preview.find_preview(
Article.normalize_url(a.link))
if preview_row
preview = OpenStruct.new(
JSON.parse(preview_row.value))
end
@articles << [a, preview]
end
render :list_articles
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment