Rails >= 3.2 (including Rails 4+ and 5+):
class Countries < ActiveRecord::Base
self.table_name = "cc"
end
Rails <= 3.1:
class Countries < ActiveRecord::Base
self.set_table_name "cc"
...
end
More Related Contents:
- Difference between attr_accessor and attr_accessible
- Single table inheritance and where to use it in Rails
- Is there a way to get a collection of all the Models in your Rails app?
- No route matches “/users/sign_out” devise rails 3
- Disable ActiveRecord for Rails 4
- Creating a many to many relationship in Rails
- Rails model without database
- ExecJS::RuntimeError in Users#index (RoR)
- Paperclip exception : Paperclip::AdapterRegistry::NoHandlerError
- Rails 3: Get Random Record
- Rails .where vs .find
- Overriding a Rails default_scope
- Error installing libv8: ERROR: Failed to build gem native extension
- Rails /lib modules and
- Rails 4 image-path, image-url and asset-url no longer work in SCSS files
- How do I set up email confirmation with Devise?
- Named routes _path vs _url
- How to sign in a user using Devise from a Rails console?
- Using Rails-UJS in JS modules (Rails 6 with webpacker)
- Check if record exists from controller in Rails
- Extending controllers of a Rails 3 Engine in the main app
- How to get Ruby / Homebrew / RVM to work on Yosemite?
- Difference between Render and Render Partial and Yield
- How to implement Active Record inheritance in Ruby on Rails?
- Setup sunspot solr with rails in production environment
- Using link_to with embedded HTML
- Looking for suggestions for building a secure REST API within Ruby on Rails
- Fall back to default language if translation missing
- Installing Ruby on Rails – Mac OS Lion
- Sass import error in Rails 3 app – “File to import not found or unreadable: compass”