Hi Sean, Two ways spring to mind, in your writer code can you just add a to_s when you access the comment field, or if not add a new read ony accessor to the model something like commentAsString:
attr_readonly(:comment_as_string) <-- Check the format for this, as I am not sure this is correct def commentAsString comment.to_s end Cheers Geoff Hobo_Fan wrote: > Hi All, > > Is there a way in Hobo to convert Text to String? I have a field in my > model called comments, which is a text field. However, when I try to > show this field in my pdf::writer, it complains about the type. > > TypeError (HoboFields::Text can't be referred): > c:/ruby/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0/lib/ > transaction/simple.rb:129:in `dump' > c:/ruby/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0/lib/ > transaction/simple.rb:129:in `start_transaction' > c:/ruby/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0/lib/ > transaction/simple/group.rb:102:in `start_transaction' > c:/ruby/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0/lib/ > transaction/simple/group.rb:102:in `each' > c:/ruby/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0/lib/ > transaction/simple/group.rb:102:in `start_transaction' > c:/ruby/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8/lib/pdf/ > simpletable.rb:396:in `render_on' > /app/controllers/products_controller.rb:73:in `index' > > Any ideas? > > Thanks, > Sean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
