WiceGrid 3.6.0.pre4 examples

Most simple grid

The simplest grid is defined by the grid helper with column blocks inside for each column. The value of each column block is the contents of a cell.

  • # encoding: utf-8
    class Basics1Controller < ApplicationController
      def index
        @tasks_grid = initialize_grid(Task)
      end
    end
    
  • <%= grid(@tasks_grid) do |g|
    
      g.column do |task|
        task.id
      end
    
      g.column  do |task|
        task.title
      end
    
      g.column do |task|
        task.description
      end
    
      g.column do |task|
        task.archived? ? 'Yes' : 'No'
      end
    
      g.column do |task|
        task.created_at.to_s(:short)
      end
    
      g.column do |task|
        link_to('Edit', edit_task_path(task))
      end
    end -%>
    
  • .well
      %h2= current_page_title
      %p
        The simplest grid is defined by the
        %code grid
        helper with column blocks inside  for each column.
        The value of each column block is the contents of a cell.
    
    = show_code
    
    .row-fluid
      .col-md-12
        = render   'grid'
221-240 / 500 show all
327inventoreSaepe quos molestiae id non odio voluptate.No08 Apr 12:37Edit
102inventore eligendi voluptasOdio autem at officia tempora labore.No11 Jun 12:37Edit
348inventore sedSuscipit occaecati et tempore similique voluptatem aut quae.No21 Mar 12:37Edit
456inventore voluptasQuis molestiae ipsa omnis blanditiis ut dolores.No31 May 12:37Edit
429ipsamAccusamus a vel suscipit facere officia doloribus.No30 Apr 12:37Edit
416ipsamSit dolore accusantium maxime.Yes28 Apr 12:37Edit
174ipsa quia voluptasQuod assumenda deleniti cupiditate soluta neque.No18 Apr 12:37Edit
163ipsa quoEt vel dolorum quae.No11 Apr 12:37Edit
50ipsum nam temporeBlanditiis totam ab aut.No10 Apr 12:37Edit
278itaqueEveniet quam sint occaecati qui expedita asperiores.Yes25 Apr 12:37Edit
17itaque suscipit commodiEt ut eveniet deleniti voluptatem omnis ea magnam et.No30 Mar 12:37Edit
295itaque velitVoluptatem rerum non expedita illum et quod.No30 Apr 12:37Edit
411iureVelit error et fugiat fuga provident debitis expedita.No21 Mar 12:37Edit
183iureFugiat sit unde quibusdam iste autem in.No14 Apr 12:37Edit
73iure architectoVoluptatum aperiam ad dolore aut fugit.No05 Apr 12:37Edit
131iure autem ametOmnis tenetur dolores commodi consequatur nobis.No05 May 12:37Edit
245iure utDolores veniam quia sint est a.No01 Jun 12:37Edit
285iure veniam numquamVoluptas eius possimus eos voluptates asperiores voluptatem perferendis.No29 May 12:37Edit
298iusto quae ipsamEa nihil vel ea.No10 May 12:37Edit
329iusto sit rerumIste placeat voluptas possimus ut quasi optio.No31 May 12:37Edit

Fork me on GitHub