Showing posts with label Ruby on Rails. Show all posts
Showing posts with label Ruby on Rails. Show all posts

Introduction

Ruby on Rails is a framework that makes it easier to develop, deploy, and
maintain web applications. During the months that followed its initial release,
Rails went from being an unknown toy to being a worldwide phenomenon. It
has won awards, and, more important, it has become the framework of choice
for the implementation of a wide range of so-called Web 2.0 applications. It
isn’t just trendy among hard-core hackers: many multinational companies are
using Rails to create their web applications.
Why is that? There seem to be many reasons.
First, there seemed to be a large number of developers who were frustrated
with the technologies they were using to create web applications. It didn’t seem
to matter whether they were using Java, PHP, or .NET—there was a growing
sense that their job was just too damn hard. And then, suddenly, along came
Rails, and Rails is easier.
But easy on its own doesn’t cut it. We’re talking about professional developers
writing real-world web sites. They wanted to feel that the applications they
were developing would stand the test of time—that they were designed and
implemented using modern, professional techniques. So these developers dug
into Rails and discovered it wasn’t just a tool for hacking out sites.
For example, all Rails applications are implemented using the Model-View-
Controller (MVC) architecture. Java developers are used to frameworks such
as Tapestry and Struts, which are based on MVC. But Rails takes MVC further:
when you develop in Rails, there’s a place for each piece of code, and all the
pieces of your application interact in a standard way. It’s as if you start out
with the skeleton of an application already prepared.
Professional programmers write tests. And again, Rails delivers. All Rails appli-
cations have testing support baked right in. As you add functionality to thecode, Rails automatically creates test stubs for that functionality. The frame-
work makes it easy to test applications, and as a result Rails applications tend
to get tested.

Read More......

Introduction

Ruby on Rails is a framework that makes it easier to develop, deploy, and
maintain web applications. During the months that followed its initial release,
Rails went from being an unknown toy to being a worldwide phenomenon. It
has won awards, and, more important, it has become the framework of choice
for the implementation of a wide range of so-called Web 2.0 applications. It
isn’t just trendy among hard-core hackers: many multinational companies are
using Rails to create their web applications.
Why is that? There seem to be many reasons.
First, there seemed to be a large number of developers who were frustrated
with the technologies they were using to create web applications. It didn’t seem
to matter whether they were using Java, PHP, or .NET—there was a growing
sense that their job was just too damn hard. And then, suddenly, along came
Rails, and Rails is easier.
But easy on its own doesn’t cut it. We’re talking about professional developers
writing real-world web sites. They wanted to feel that the applications they
were developing would stand the test of time—that they were designed and
implemented using modern, professional techniques. So these developers dug
into Rails and discovered it wasn’t just a tool for hacking out sites.
For example, all Rails applications are implemented using the Model-View-
Controller (MVC) architecture. Java developers are used to frameworks such
as Tapestry and Struts, which are based on MVC. But Rails takes MVC further:
when you develop in Rails, there’s a place for each piece of code, and all the
pieces of your application interact in a standard way. It’s as if you start out
with the skeleton of an application already prepared.
Professional programmers write tests. And again, Rails delivers. All Rails appli-
cations have testing support baked right in. As you add functionality to thecode, Rails automatically creates test stubs for that functionality. The frame-
work makes it easy to test applications, and as a result Rails applications tend
to get tested.

Read More......

Perintah Penting Dalam Ruby on Rails

Rake adalah utilitas untuk membuat serupa di Unix. Anda dapat berkata Rake adalah membuat dari ruby - R uby m AKE. Rails mendefinisikan jumlah tugas untuk membantu Anda.

Berikut adalah daftar berbagai perintah penting didukung oleh Rake:
menyapu db: Fixtures: beban - Load Fixtures ke dalam database dari lingkungan saat ini. Beban khusus menggunakan Fixtures Fixtures = x, y
1. menyapu db: migrasi - migrasi database melalui script di db / bermigrasi. Target khusus dengan versi VERSION = x
2. menyapu db: skema: dump - Buat db / schema.rb file yang dapat digunakan terhadap portably DB didukung oleh AR.
3. menyapu db: skema: beban - Load schema.rb sebuah file ke dalam database.
4. menyapu db: sessions: clear - Menghapus sesi tabel.
5. menyapu db: sesi: buat - Menciptakan sebuah sesi meja untuk digunakan dengan CGI:: Session:: ActiveRecordStore.
1. menyapu db: structure: dump - Dump struktur database ke file SQL.
2. menyapu db: test: clone - Recreate ujian dari database yang sekarang lingkungan database skema.
3. menyapu db: test: clone_structure - Recreate ujian database dari pembangunan struktur.
4. menyapu db: test: mempersiapkan - Siapkan test database dan mengambil skema.
5. menyapu db: test: purge - Kosong ujian database.
6. menyapu doc: app yang appBuild HTML File.
7. menyapu doc: clobber_app - Hapus rdoc produk.
8. menyapu doc: clobber_plugins - Hapus dokumentasi plugin.
9. menyapu doc: clobber_rails Hapus rdoc produk.
10.rake doc: plugins - Menghasilkan documation untuk semua plugin terinstal.
11. menyapu doc: rails - Build the rails HTML File.
12. menyapu doc: reapp - Force yang membangun dari RDOC file
13. menyapu doc: rerails - Force yang membangun dari RDOC file
14. menyapu login: jelas - Truncates semua file-file *. log log / ke nol byte
15. menyapu rails: freeze: edge - Kunci ini ke aplikasi terbaru Edge Rails. Kunci tertentu dengan revisi Revision = X.
16. menyapu rails: freeze: Gems - Kunci ini untuk aplikasi yang sedang Gems (unpacking oleh mereka menjadi vendor / rails)
17. menyapu rails: unfreeze - Aktifkan aplikasi ini dari yang membekukan atau Gems tepi dan kembali ke cairan penggunaan sistem Gems
18. menyapu rails: update - Update kedua skrip dan publik / javascripts from Rails.
19. menyapu rails: update: javascripts - Perbarui javascripts dari sekarang rails instal.
20. menyapu rails: update: skrip - skrip baru Tambahkan ke aplikasi

Read More......

Ruby on Rails

Rake is a utility similar to make in Unix. You can say Rake is the make of ruby - the R uby m AKE. Rails defines a number of tasks to help you.

Here is a list of various important commands supported by Rake:
rake db:fixtures:load - Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y
1. rake db:migrate - Migrate the database through scripts in db/migrate. Target specific version with VERSION=x
2. rake db:schema:dump - Create a db/schema.rb file that can be portably used against any DB supported by AR.
3. rake db:schema:load - Load a schema.rb file into the database.
4. rake db:sessions:clear - Clear the sessions table.
5. rake db:sessions:create - Creates a sessions table for use with CGI::Session::ActiveRecordStore.
1. rake db:structure:dump - Dump the database structure to a SQL file.
2. rake db:test:clone - Recreate the test database from the current environment's database schema.
3. rake db:test:clone_structure - Recreate the test databases from the development structure.
4. rake db:test:prepare - Prepare the test database and load the schema.
5. rake db:test:purge - Empty the test database.
6. rake doc:appBuild the app HTML Files.
7. rake doc:clobber_app - Remove rdoc products.
8. rake doc:clobber_plugins - Remove plugin documentation.
9. rake doc:clobber_rails Remove rdoc products.
10.rake doc:plugins - Generate documation for all installed plugins.
11. rake doc:rails - Build the rails HTML Files.
12. rake doc:reapp - Force a rebuild of the RDOC files
13. rake doc:rerails - Force a rebuild of the RDOC files
14. rake log:clear - Truncates all *.log files in log/ to zero bytes
15. rake rails:freeze:edge - Lock this application to latest Edge Rails. Lock a specific revision with REVISION=X.
16. rake rails:freeze:gems - Lock this application to the current gems (by unpacking them into vendor/rails)
17. rake rails:unfreeze - Unlock this application from freeze of gems or edge and return to a fluid use of system gems
18. rake rails:update - Update both scripts and public/javascripts from Rails.
19. rake rails:update:javascripts - Update your javascripts from your current rails install.
20. rake rails:update:scripts - Add new scripts to the application script/

Read More......