jnunemaker/happymapper — Issue #20: Installation and setup
Author: fenelon
Created: 2011-10-20 20:46:33+00:00
State: open

Hi,

I'm really sorry for such a question, but I can't get happymapper to work =(

I'm currently using 3.1 and that's what I did:

1) Added gem 'happymapper' to gemfile and Bundled it
2) Inside my controller file added these two:

class Reference
include HappyMapper
element :listName, String
element :itemCount, Integer
end

class Item
include HappyMapper
element :id, Integer
element :name, String
end

3)Then, in my controller action:

file_contents = File.read('tmp/spo.xml')
refs = Reference.parse(file_contents)
@id = refs.item.first.id
@name = refs.item.first.id

4) It throws uninitialized constant Reference::HappyMapper

PS I also tried to require it, but it says no such file to load -- happymapper

Thanks a lot! Great job!