daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PagesController < ApplicationController
  2.   def index
  3.     params[:per_page] ||= 5
  4.     params[:page]     ||= 1
  5.  
  6.     @links = Link.order('voteCount DESC').paginate(:page => params[:page], :per_page => params[:per_page])
  7.  
  8.   end
  9. end
  10.    
  11. .order('voteCount DESC')
  12.    
  13. Link Load (2.0ms)  SELECT "links".* FROM "links" ORDER BY voteCount DESC LIMIT 5 OFFSET 0
  14. ActiveRecord::StatementInvalid: PG::Error: ERROR:  column "votecount" does not exist
  15. LINE 1: SELECT  "links".* FROM "links"  ORDER BY voteCount DESC LIMI...
  16.                                                  ^
  17.    
  18. create_table :links do |t|
  19.   t.integer :voteCount
  20. end
  21.    
  22. "voteCount" integer
  23.    
  24. .order('"voteCount" DESC')
  25.    
  26. heroku run rake db:migrate
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top