great list of ruby on rails cheatsheets

Hello again. Today a tell a little bit about ruby on rails cheatsheets. Where you can find them and of course i show you some examples what you can find in this page. Ruby on rails is popular in nowadays and if you use it for your web site than you need know some of them and some of them of course will be useful be in your daily programming work. All information is for Rails 2.1.

  1. Table methods
  2. example_migration.rb
  3. Database Mapping
  4. Rake tasks
  5. Directory structure
  6. Shortcut methods
  7. Column methods
  8. Indexes
  9. Miscellaneous methods
  10. script/generate
  11. Loading fixtures

Table methods: change_table

change_table :table_name do |t|
  t.change :column_name, :new_column_type
  t.remove :column_name
end

create_table

create_table :table_name, {table_options} do |t|
  t.string :name, {column_options}
end

Rake tasks

db:create
db:create:all
db:drop
db:drop:all
db:migrate:up
db:migrate:down

Shortcut methods

t.column               t.change                t.rename
t.remove               t.change_default        t.references
t.remove_references    t.belongs_to            t.remove_belongs_to
t.timestamps           t.index                 t.remove_index

And many more useful cheatsheets just click here and know more….

URL: http://dizzy.co.uk/ruby_on_rails/cheatsheets/rails-migrations

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Tags: , , , , ,



  1. It‘s quite in here! Why not leave a response?