Closed fluxsaas closed 11 years ago
I'm not sure I understand what you are saying. I'll be glad to help but I need some background info first.
If I run:
require 'json_builder'
json = JSONBuilder::Compiler.generate do
@shifts = [{:id => 1, :title => 'test', :ends => Time.now}]
array @shifts do |shift|
id shift[:id]
title shift[:title]
key :end, shift[:ends]
end
end
puts json
I will get the expected output:
[{"id": 1, "title": "test", "end": "2012-09-26T23:04:08-07:00"}]
ok, i guess it was too late at night....
key :end, shift[:ends]
does the trick. i going to check for the "title" key again. not sure why it wasn't working.
thanks for the help!
No problem! Although locally send("end", shift[:ends])
works for me.
Hey, i just notices that i have some problems with naming like:
=> title dies not get displayed at all, well "end" is not working but my workaround does :)