Override to_json in Rails 2.3.5

Posted by smotchkkiss on Stack Overflow See other posts from Stack Overflow or by smotchkkiss
Published on 2010-04-03T18:49:09Z Indexed on 2010/04/03 18:53 UTC
Read the original article Hit count: 368

Filed under:
|
|
|

I've seen some other examples on SO, but I none do what I'm looking for.

I'm trying:

class User < ActiveRecord::Base

  def to_json
    super(:only => :username, :methods => [:foo, :bar])
  end

end

I'm getting ArgumentError: wrong number of arguments (1 for 0).

Any ideas?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about methods