ruby on rails 4 - Content duplication Prawn -


i'm create user can see content online or download it.

i have nested table duplication , cannot see why.

  def header     table header_container_table       columns(1..2).align = :center       columns(0..2).border_width = 2     end   end    def header_container_table     contenido_header = [[{image: "#{rails.root}/app/assets/images/logo.png", scale: 0.6}, header_inner_table_rows]]   end    def header_inner_table      inner_content = [["line 1"], ["line 2"], ["line 3"], ["line 4"]]   end    def header_inner_table_rows       table header_inner_table         rows(0).size = 18         columns(0).align = :center         rows(2..3).size = 8       end   end 

what i'm doing wrong?

i found solution issue. avoid duplication of content have use method nested table make_table.

so based on code above should be:

def header_inner_table_rows       make_table header_inner_table         rows(0).size = 18         columns(0).align = :center         rows(2..3).size = 8       end   end 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -