Skip to content

Instantly share code, notes, and snippets.

@karmiclychee
Last active December 17, 2015 13:19
Show Gist options
  • Save karmiclychee/5615806 to your computer and use it in GitHub Desktop.
Save karmiclychee/5615806 to your computer and use it in GitHub Desktop.
[15] pry(main)> Site
=> Site(Table doesn't exist)
[16] pry(main)> ActiveRecord::Base.connection.tables
=> ["schema_migrations", "site"]
Error:
PG::Error: ERROR: relation "sites" does not exist
LINE 5: WHERE a.attrelid = '"sites"'::regclass
Offending line:
class SitesController < ApplicationController
def new
> @site = Site.new
end
Schema
create_table "site", :force => true do |t|
t.string "name"
t.string "url"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment