Skip to content

Commit

Permalink
user_id for assets json
Browse files Browse the repository at this point in the history
  • Loading branch information
sudara committed Jan 22, 2009
1 parent 759a104 commit 001e47d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
1 change: 0 additions & 1 deletion vendor/plugins/haml/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.