#991 new
Tim Griffin

<table-plus> needs documentation explaining when heading tags REQUIRED

Reported by Tim Griffin | December 30th, 2011 @ 11:26 AM

The documentation for <table-plus> needs updating to explain cases where heading tags MUST be included. I'm not sure what these particular cases are, but with Hobo 1.3, I ran into an issue displaying a <table-plus> using a manually-created array of OpenStruct records that did not include <xxx-heading> tags. Hobo continually reported a "can't convert String into Integer" error when processing the <table-plus> tag.

Better trapping and reporting of this error condition would be helpful.

I was using this approach:

def get_documents  
    
    #Setup a new 3-column array to hold the document records
    table = Array.new    

    documents = Document.find_by_sql('SELECT dbo.LLAttrBlobData.ID AS [doc_id],... ... ')

    r = 0                
    documents.each do |doc|
      
      table[r] = OpenStruct.new(:doc_id => doc.doc_id, 
                      :filing_date => doc.filing_date, 
                      :filing => doc.filing)

      r = r + 1
    end
    
    return table
    
  end

And in the view:

  <table-plus:get_documents fields="doc_id,filing_date,filing">
  </table-plus:get_documents>

Hobo generated

can't convert String into Integer

Bryan indicated that "with many versions of Hobo,
you need to specify the headings:"

<table-plus:get_documents fields="doc_id,filing_date,filing">
  <doc-id-heading:>ID</doc-id-heading:>
  <filing-date-heading:>filing date</filing-date-heading:>
  <filing-heading:></filing-heading:>

Specifying the headings made <table-plus> work as expected.

He notes: "it broke in 1.3 because of the internationalization changes. It's something we need
to add to the test suite."

Tim

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages