This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DaCottage:~ chad$ rvm --trace 1.8.7@pusher | |
--trace 1.8.7@pusher | |
rvm 0.1.38 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/] | |
+ [[ -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] | |
+ [[ 1 -gt 0 ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'mongo' | |
USER = 'tiger' | |
PASS = 'censusTIGER2009' | |
db = Mongo::Connection.new('flame.mongohq.com', 27058).db('tiger-2009') | |
db.authenticate(USER, PASS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Simple Search/Pagination Example</h1> | |
<%= will_paginate @users %> | |
<% @users.each do |user| %> | |
<div> | |
<%= user.name %> (<%= user.email %>) | |
</div> | |
<% end %> | |
<%= will_paginate @users %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::UsersController < Admin::BaseController | |
... | |
def search | |
@users = User.search params[:s] | |
respond_to do |format| | |
format.html # show.html.erb | |
format.xml { render :xml => @users } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
... | |
define_index do | |
indexes [:first_name, :last_name], :as => :name, :sortable => true | |
indexes :email, :sortable => true | |
has created_at, updated_at | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::BaseController < ApplicationController | |
include AuthenticatedSystem | |
include SslRequirement | |
audit Affiliate, Category, Industry, Permission, Promotion | |
before_filter :login_required | |
before_filter :site_administrator? | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@criteria = params[:criteria] | |
if @criteria.size > 1 | |
@result = Page.multi_solr_search @criteria, :models => [Brand, Leader, Career, Release] | |
if @result.nil? | |
@result = "Sorry no results for your search." | |
end | |
else | |
@result = "Please refine your search using more specific keywords." | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake solr:start |