I have an application which uses gcal4ruby and retrieves events from a
Calendar object.
The events are received fine and I can look at them in the console
however, when I try to render them in xml by using the following line
render :xml => e
I get the ArgumentError, ‘wrong number of arguments (1 for 0)’.
Just to see if the data is there, I also did ‘render :text =>
e.to_xml’, the object is displayed (the xml labels are swallowed up
by the browser but I can see the content).
I’ve search all over for what possible reason render :xml would fail
with this error but I’m having no luck.
Any ideas are greatly appreciated.
Here’s the controller code:
s=Service.new
s.authenticate('mylogin','mypassword')
@cal=Calendar.find(s,{:title=>"Public"}).first
@events = @cal.events
[email protected]
respond_to do |format|
format.html { render :xml => e }
end
Here’s the end of the stack trace:
ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/
renderers.rb:87:in to_xml' ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/ renderers.rb:87:in
_render_option_xml’
ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/
renderers.rb:40:in _handle_render_options' ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/ renderers.rb:47:in
render_to_body’
ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/
compatibility.rb:55:in render_to_body' ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb: 101:in
render_to_string’
ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:
92:in render' ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/ rendering.rb:17:in
render’
ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/
instrumentation.rb:40:in `render’
…