5

I have configured my rails app to consume Redmine api using Active resource. In my model redmine.rb, i put the following code

require 'active_resource'  

class Redmine < ActiveResource::Base
  self.site = "http://localhost:9000/"
  self.format = :json  
  self.element_name = "issues"
  self.user = "admin"
  self.password = "admin"
end 

And in my controller

def index
  @data = Redmine.find(:all)
end

But its showing argument error ArgumentError at expected an attributes Hash, got and showing the json data with this error.

How to get out of this error, I am using

gem 'activeresource', :require => 'active_resource'

But when i am using XML parsing its showing no error, then i think problem is in json parsing. please help me to figure it out.

infused
  • 24,000
  • 13
  • 68
  • 78
sukanta
  • 541
  • 6
  • 18

0 Answers0