DSL question #44

meesterdude opened this Issue May 11, 2012 · 1 comment


None yet
3 participants

Loving jbuilder, but I had a question. What is the reasoning behind the syntax of json.(@message, :created_at, :updated_at)? I like what it does but it's not so clear when reading.


bigjason commented May 11, 2012

@meesterdude Its just syntactic sugar to call a proc in ruby 1.9. You can read about it here here. Functionally it is the same as:

json.call(@message, :created_at, :updated_at)

dhh closed this Aug 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment