Assuming I can''t rename my MySQL tables, how would I modify a model so that it''s called one thing but references a table of a completely different name. For example: class Recipe < ActiveRecord::Base # The actual table is called "FoodInstructions", but I don''t want to use that. end class HomeController < ApplicationController def index @Recipe = Recipes.find_all end end -- Posted via http://www.ruby-forum.com/.
Never mind. I finally figured out how to search for what I needed and I found the answer in another post. -- Posted via http://www.ruby-forum.com/.
On Aug 11, 2006, at 1:35 PM, MenDAKE wrote:> class Recipe < ActiveRecord::Base > > # The actual table is called "FoodInstructions", but I don''t want to > use that. > > endclass Recipe < ActiveRecord::Base set_table_name "FoodInstructions" end -Ezra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060811/1ee347dc/attachment.html