I have a controller action that returns JSON data.
def create
@comment = @site_update.comments.new
@comment.attributes = params[:comment]
@comment.author = current_user
if @comment.save
respond_with @comment, :include => :author
else
respond_with @comment.errors
end
end
This is obviously not working. How can I include the :author of the
comment with the respond_with method?
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.