Permalink
Browse files

template tweak for individual stream_item

  • Loading branch information...
1 parent 61174da commit 685a9bcdfd3f913edea775799aa04a25382c29aa @worace worace committed May 22, 2012
Showing with 8 additions and 6 deletions.
  1. +2 −1 app/controllers/api/stream_items_controller.rb
  2. +6 −5 app/views/api/stream_items/show.json.jbuilder
@@ -2,7 +2,8 @@ class Api::StreamItemsController < Api::BaseController
before_filter :verify_auth_token_match, :only => :create
def show
@user = User.where(:display_name => params[:display_name]).first
- @item = @user.stream_items.find(params[:id]).streamable
+ @stream_item = @user.stream_items.find(params[:id])
+ @item = @stream_item.streamable
end
def create
@@ -1,13 +1,14 @@
-json.(@item, :id, :created_at)
+json.(@stream_item, :id, :created_at)
json.type @item.class.name
json.image_url @item.url if @item.is_a?(ImageItem)
json.link_url @item.url if @item.is_a?(LinkItem)
json.body @item.body if @item.is_a?(TextItem)
json.comment @item.comment if @item.is_a?(LinkItem) || @item.is_a?(ImageItem)
-json.feed "http://api.feedengine.com/feeds/#{@item.user.display_name}"
-json.link api_item_url(@item.user, @item)
-json.refeed false
-json.refeed_link ""
+json.feed api_feed_url(@stream_item.user)
+json.link api_item_url(@stream_item.user, @stream_item)
+json.refeed @stream_item.refeed
+json.refeed_link api_refeed_item_url(@stream_item.user, @stream_item)
+

0 comments on commit 685a9bc

Please sign in to comment.