I have added following code in user.rb.
def as_json(options={})
h = super(:only => [:id, :content, :created_at, :updated_at])
h
end
But in another api I have to get username and address as well. But producing these four fields when rendering json. How can I get both outputs. Thanks in advance