WiceGrid 3.6.0.pre4 examples

Named columns

The name parameter adds names of columns to the grid.

  • # encoding: utf-8
    class Basics2Controller < ApplicationController
      def index
        @tasks_grid = initialize_grid(Task)
      end
    end
    
  • .well
      %h2= current_page_title
      %p
        The
        %code name
        parameter adds names of columns to the grid.
    
    = show_code
    
    .row-fluid
      .col-md-12
        = render   'grid'
  • <%= grid(@tasks_grid) do |g|
    
      g.column name:  'ID' do |task|
        task.id
      end
    
      g.column name:  'Title'  do |task|
        task.title
      end
    
      g.column  name:  'Description' do |task|
        task.description
      end
    
      g.column  name:  'Archived' do |task|
        task.archived? ? 'Yes' : 'No'
      end
    
      g.column name:  'Added' do |task|
        task.created_at.to_s(:short)
      end
    
    
      g.column   do |task|
        link_to('Edit', edit_task_path(task))
      end
    end -%>
    
IDTitleDescriptionArchivedAdded
81-100 / 500 show all
81ad quo dolorTempora culpa laborum et illum suscipit facilis earum et.No05 May 12:37Edit
82utEt debitis enim repellat qui voluptatem a nam nisi.No04 Jun 12:37Edit
83enimUt molestias ducimus dignissimos.No14 Mar 12:37Edit
84doloreOdio laboriosam velit pariatur ea autem distinctio.No04 Apr 12:37Edit
85voluptatibus inventoreHarum aliquam amet et inventore.Yes12 Jun 12:37Edit
86adipisciConsectetur optio rerum facilis explicabo enim consequatur delectus iste.No08 Apr 12:37Edit
87nostrumTempore ad qui velit nihil ipsam.No13 Jun 12:37Edit
88culpaOccaecati aut eum vero quasi dolorem.No25 May 12:37Edit
89provident consequatur remSint at soluta earum.No30 Mar 12:37Edit
90commodi et quisConsequatur soluta eligendi et consequatur.No27 Apr 12:37Edit
91quaeratFacere ullam veniam inventore ea.No08 Jun 12:37Edit
92est praesentiumModi pariatur voluptatem perspiciatis.No08 Jun 12:37Edit
93autId vero doloremque animi unde.No04 Apr 12:37Edit
94officiisIllum minus rerum expedita.No01 Apr 12:37Edit
95quibusdam beatae adVoluptas aperiam beatae architecto provident cum.Yes05 May 12:37Edit
96impedit explicabo voluptatemHic eveniet pariatur non nostrum.No02 Jun 12:37Edit
97voluptatem facilis etIncidunt dolorem molestias deserunt repellat vero aut.No15 Mar 12:37Edit
98aperiam rerumRerum quaerat eligendi voluptatem.Yes31 May 12:37Edit
99solutaOfficiis omnis esse est debitis laboriosam.No25 Mar 12:37Edit
100autem nonMinus autem provident ex culpa sit.No02 May 12:37Edit

Fork me on GitHub