ruby on rails - JBuilder as_json to_json -


does jbuilder use as_json or to_json render?

i attempting override as_json , to_json alias, similar below:

  module bson     class objectid        def as_json(*args)         to_s       end        alias :to_json :as_json      end   end 

then use jbuilder render return object. however, acts if using neither to_json or as_json render.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -