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'
101-120 / 500 show all
95quibusdam beatae adVoluptas aperiam beatae architecto provident cum.Yes05 May 12:37Edit
45rerumRepellat et ut eos ea illo et dolorum voluptatem.No15 Jun 12:37Edit
9quisquam in isteEt fugiat blanditiis facilis asperiores et.No07 Jun 12:37Edit
289quasiQui est mollitia minus tempore eaque perferendis non.No31 May 12:37Edit
138sint quiCommodi qui fugiat eum aut consequuntur.No01 Jun 12:37Edit
321quis est autemAmet veniam quia molestias eum modi impedit rerum ad.No02 May 12:37Edit
373commodiSit minima ab voluptas dolorem cumque.No13 Apr 12:37Edit
413voluptateAnimi esse amet nihil ad nobis voluptatum.No25 Mar 12:37Edit
44id temporibus eligendiId dignissimos dolorem enim ut.No27 Mar 12:37Edit
384quiaNihil voluptas unde voluptas nobis.No27 May 12:37Edit
246eos laborumDelectus assumenda sint praesentium est.No19 Apr 12:37Edit
472perspiciatisNihil qui dolore dignissimos dicta.No26 Mar 12:37Edit
476facere voluptasOccaecati consectetur neque ullam dolores qui.Yes21 May 12:37Edit
465totamQui adipisci aspernatur qui non.No23 Apr 12:37Edit
197non autemHarum eum labore ad.No25 May 12:37Edit
299consequaturExercitationem voluptatem sint ad.No14 Apr 12:37Edit
478necessitatibusQui omnis tempora velit.No10 May 12:37Edit
429ipsamAccusamus a vel suscipit facere officia doloribus.No30 Apr 12:37Edit
296cupiditate in minimaSit aspernatur tempore id.Yes02 May 12:37Edit
318beataeQuaerat veniam architecto est.No13 Mar 12:37Edit

Fork me on GitHub