Skip to content

Instantly share code, notes, and snippets.

@drale2k
Created August 31, 2012 01:01
Show Gist options
  • Save drale2k/3547025 to your computer and use it in GitHub Desktop.
Save drale2k/3547025 to your computer and use it in GitHub Desktop.
# @news from news_controller#index
collection @news
attributes :id, :title, :excerpt, :content, :image, :source, :published_at, :created_at
node :excerpt do |news|
truncate(news.excerpt, :length => 100)
end
node :content do |news|
strip_links news.content
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment