require "action_controller/railtie" require "active_resource/railtie" require 'wice_grid' module Test class Application < Rails::Application config.secret_token = '84198d9ba8d271b3d95d252b17601cb0f4b18b5a790d0c1d9bcce95e1c03d9d6f615b21b66986a2bf2ea9b5e850e30f09dfbfa9ffa2586b8ce1f5f1a2e4a460d' config.public_path = File.join(File.dirname(__FILE__), '/public') end end class Computer include Mongoid::Document belongs_to_related :user field :name end class User include Mongoid::Document #identity :type => String field :first_name field :year, :type => Date field :last_login, :type => Time field :computers_number, :type => Integer field :archived, :type => Boolean def self.merge_conditions(*conditions) "" end end class UsersController < ActionController::Base def self.columns(&block) @@define_columns = block end def columns(grid) @@define_columns.call(grid) end def index @users_grid = initialize_grid(User) render :inline => <