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.
- Table methods
- example_migration.rb
- Database Mapping
- Rake tasks
- Directory structure
- Shortcut methods
- Column methods
- Indexes
- Miscellaneous methods
- script/generate
- 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
Tags: cheatsheets, migration, rubu on rails, ruby 2.1, table, Tutorials



















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