Created
November 24, 2010 23:33
-
-
Save onlymejosh/714632 to your computer and use it in GitHub Desktop.
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
Mysql::Error: Table 'af_development.shows' doesn't exist: SELECT `shows`.* FROM `shows` | |
models/af.rb | |
module Af | |
def self.table_name_prefix | |
'af_' | |
end | |
end | |
models/af/show.rb | |
class Af::Show < ActiveRecord::Base | |
validates_presence_of :title | |
validates_uniqueness_of :title | |
belongs_to :topic | |
has_many :presentations, :dependent => :delete_all | |
end | |
routes | |
namespace :af do | |
resources :presentations | |
resources :shows | |
resources :slides | |
resources :topics | |
resources :videos | |
end | |
new_af_show GET /af/shows/new(.:format) {:action=>"new", :controller=>"af/shows"} | |
edit_af_show GET /af/shows/:id/edit(.:format) {:action=>"edit", :controller=>"af/shows"} | |
af_show GET /af/shows/:id(.:format) {:action=>"show", :controller=>"af/shows"} | |
PUT /af/shows/:id(.:format) {:action=>"update", :controller=>"af/shows"} | |
DELETE /af/shows/:id(.:format) {:action=>"destroy", :controller=>"af/shows"} | |
class CreateAfShows < ActiveRecord::Migration | |
def self.up | |
create_table :af_shows do |t| | |
t.string :title | |
t.text :description | |
t.integer :topic_id | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :af_shows | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment