Permalink
Browse files

user_id for assets json

  • Loading branch information...
1 parent 759a104 commit 001e47dc52fe59f3c114516d6cd1f0f025d59b78 @sudara sudara committed Jan 22, 2009
Showing with 2 additions and 3 deletions.
  1. +1 −1 app/controllers/assets_controller.rb
  2. +1 −1 app/controllers/users_controller.rb
  3. +0 −1 vendor/plugins/haml/init.rb
View
2 app/controllers/assets_controller.rb
@@ -31,7 +31,7 @@ def index
end
end
format.json do
- render :json => '{ records : ' + @assets.to_json(:methods => [:name, :type, :length], :only => [:id,:name,:listens_count, :description,:permalink,:hotness]) + '}'
+ render :json => '{ records : ' + @assets.to_json(:methods => [:name, :type, :length], :only => [:id,:name,:listens_count, :description,:permalink,:hotness, :user_id]) + '}'
end
end
end
View
2 app/controllers/users_controller.rb
@@ -31,7 +31,7 @@ def index
# API
format.json do
users = User.musicians.find(:all,:include => :pic)
- render :json => '{ records : ' + users.to_json(:methods => [:name, :type, :avatar], :only => [:id,:name,:comments_count,:bio_html,:website,:login,:tracks_count,:created_at]) + '}'
+ render :json => '{ records : ' + users.to_json(:methods => [:name, :type, :avatar], :only => [:id,:name,:comments_count,:bio_html,:website,:login,:tracks_count,:created_at, :user_id]) + '}'
end
# format.fbml do
# @users = User.paginate(:all, :per_page => 10, :order => 'listens_count DESC', :page => params[:page])
View
1 vendor/plugins/haml/init.rb
@@ -4,5 +4,4 @@
require 'haml' # From gem
end
-# Load Haml and Sass
Haml.init_rails(binding)

0 comments on commit 001e47d

Please sign in to comment.