Snippets: Coldfusion Abort

June 26, 2007 @ 06:01 AM | posted by carmelyne

(last updated: 06.26.07)

Halt who goes there!

1
2
3
4
<cfif CGI.REMOTE_HOST IS NOT "127.0.0.1" 
  AND CGI.REMOTE_HOST IS NOT "192.168.0.1">
  <cfabort>
</cfif>

[ Last updated: June 26, 2007 @ 06:03 AM ]

Sorry, comments are closed for this article.

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 
RailsConf 2006
I heart devChix