Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Rails help rewriting show action to PostgreSQL
  2. def show
  3.     @kategori = Kategori.find(:first, :conditions => "cached_slug = '#{params[:id]}'")
  4.     @konkurrancer = (@kategori.konkurrancers).order(sort_column + " " + sort_direction)
  5.   end
  6.        
  7. def show
  8.   @kategori = Kategori.where(:cached_slug => params[:id]).first
  9.   @konkurrancer = @kategori.konkurrancers.order("#{sort_column} #{sort_direction}")
  10. end
  11.        
  12. def show
  13.  @kategori = Kategori.find(:first, :conditions => ['cached_slug=?', params[:id]])
  14. end