WiceGrid 3.6.0.pre4 examples

Generating custom filter parameters

Helper wice_grid_custom_filter_params simplifies generation of links with HTTP parameters understood by WiceGrid custom filter parameters.

  • # encoding: utf-8
    class CustomFilterParamsController < ApplicationController
      def index
        @projects_grid = initialize_grid(Project)
      end
    end
    
  • .well
      %h2= current_page_title
      %p
        Helper
        %code wice_grid_custom_filter_params
        simplifies generation of links with HTTP parameters understood by WiceGrid custom filter parameters.
    
    = show_code
    
    .row-fluid
      .col-md-4
        = render   'grid'
    
  • <%= grid(@projects_grid) do |g|
    
      g.column name:  'Project Name', attribute: 'name'  do |project|
        link_to(project.name,
                tasks_path(
                  wice_grid_custom_filter_params(
                    grid_name: 'grid',
                    attribute: 'project_id',
                    value: project.id  )))
      end
    
    end -%>

Fork me on GitHub