[id-ruby] file index di Ruby on Rails
mo tanya dong klo di Ruby on Rails tu halaman pertama yag dimunculin tu yang ada di folder view/layout/application.html.erb??? (klo di PHP kn yg index.html) ko saya edit bagian itu tapi tetep error y... pesen errornya kaya gini: The Proxy Server received an invalid response from an upstream server The proxy server could not handle the request GET/. rason :could not connect to remote machine : unknown error itu kenapa y??? apa yg harus dibenerin??? mohon bgt bantuannya... makasih banyak... mawar
[id-ruby][Help] Rake Gak Mo Ekeskusi Unit Test
c:\ruby\coba>rake test/unit/percobaan_test.rb -- trace **Invoke test/unit/percobaan_test.rb (first_time, not_needed) c:\ruby\coba>_ Ini kenapa yah? ada yang salah kah?? Thanks Reinhart Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Balasan: [id-ruby][Help] Rake Gak Mo Ekeskusi Unit Test
--- Booking Heaven <[EMAIL PROTECTED]> wrote: > c:\ruby\coba>rake test/unit/percobaan_test.rb -- trace > **Invoke test/unit/percobaan_test.rb (first_time, not_needed) kalo mau jalankan test case langsung, pake ruby bukan rake. kalo mau menjalankan via rake, tambahkan instance Rake::TestTask di dalam rakefile, misalken: require 'rake/testtask' Rake::TestTask.new do |t| t.test_files = FileList['test/unit/*_test.rb'] t.warning = true t.verbose = false end lalu jalankan: rake test rgds, Edwin. > > c:\ruby\coba>_ > > > Ini kenapa yah? ada yang salah kah?? > > Thanks > Reinhart > > Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/
Re: Balasan: [id-ruby][Help] Rake Gak Mo Ekeskusi Unit Test
thanks bos. akhirnya bisa juga. --- On Thu, 5/8/08, Edwin Pratomo <[EMAIL PROTECTED]> wrote: require 'rake/testtask' Rake::TestTask. new do |t| t.test_files = FileList['test/ unit/*_test. rb'] t.warning = true t.verbose = false end lalu jalankan: rake test rgds, Edwin. > > c:\ruby\coba> _ > > > Ini kenapa yah? ada yang salah kah?? > > Thanks > Reinhart > > _ _ _ _ Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers. yahoo.com/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: [id-ruby] [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
Kalo boleh sedikit usul gimana kalo tabel users dan addreses digabung jadi satu tabel... biar ga redundant.. @ndreas d0a98042 <[EMAIL PROTECTED]> wrote: Halo semua..saya lagi belajar Rails dan masalah dikit. Mohon bantuan teman2. Saya punya tabel users dan addresses. 1 user hanya punya 1 address. di models/user.rb class User < ActiveRecord::Base has_one :address validates_presence_of :username, :firstname, :passwd, :message => "can't empty"; validates_format_of :email, :with => /\A([EMAIL PROTECTED])@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i validates_confirmation_of :passwd enddi models/address.rb class Address < ActiveRecord::Base has_many :province belongs_to :user enddi views/user/new.rb (sebagian), form ini akan post ke user/create ... Gender <%= select :user, :gender, {"Male" => "m", "Female" => "f"} -%> Birth date <%= date_select :user, :birthdate, :order => [:day, :month, :year], :include_blank => true -%> Address <%= text_area :address, :name, :size => "35x5" -%> <%= error_message_on 'address', 'name' -%> City <%= text_field :address, :city, :size => 20 -%> ... di controllers/user def create @user = User.new(params[:user]) if @user.save @user.address.create(params[:address]) redirect_to :action => 'list' else render :action => 'new' end endwaktu saya coba, row di table user memang bertambah tapi di table address tidak, saya dapat error The error occurred while evaluating nil.createdari error tersebut saya rasa ada kesalah di @user.address.create(params[:address])tapi saya ga tau harus gmn lagi. mohon pencerahan teman-teman. Trims. [Non-text portions of this message have been removed] - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. [Non-text portions of this message have been removed]
[id-ruby] Help..
Maaf posting lagi. Begini saya ngikutin tutorial install ruby on rails dari http://www.urbanpuddle.com/articles/2008/01/09/install-ruby-on-rails-on-ubutu-gutsy-gibbon-apache-version Tapi ko udah diikutin dari awal sampe akhir malah apache dan ruby ga bisa di akses? Bisa tolong bantu? Terima kasih [Non-text portions of this message have been removed]
Re: [id-ruby][Help] Rake Gak Mo Ekeskusi Unit Test
--- In id-ruby@yahoogroups.com, Booking Heaven wrote: > c:\ruby\coba>rake test/unit/percobaan_test.rb -- trace > **Invoke test/unit/percobaan_test.rb (first_time, not_needed) > > c:\ruby\coba>_ kalau itu di dalam direktori rails berarti rake sudah support test secara default. biasakan sering2x cek dgn cara : rake -T dari sana keliatan listing perintah rake apa saja yang tersedia. bisa juga bila ingin spesifik, mis: rake -T test maka disana pasti akan Anda dapati perintah2x seperti rake test, test unit doang, dst. kecuali kalau Anda ingin ngetes satu file aja caranya ya panggil file ybs langsung (pake ruby). > Ini kenapa yah? ada yang salah kah?? > > Thanks > Reinhart http://ariekusumaatmaja.wordpress.com
[id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
--- In id-ruby@yahoogroups.com, "d0a98042" wrote: > Wah dijawab sendiri deh..saya udah dapat solusinya..buat yang punya > masalah kaya gini..tanya aja saya > > Trims. Gimana solusinya? sama codes2nya. http://www.ruby-lang.org/id
[id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
--- In id-ruby@yahoogroups.com, "d0a98042" wrote: > class Address < ActiveRecord::Base > has_many :province ehm ;-) yakin address has_many :province (atau bahkan :provinces) ? saya jadi curiga itu apa ga seharusnya malah belongs_to :province tuh > waktu saya coba, row di table user memang bertambah tapi di table > address tidak ya terang aja cuma address karena object ybs saja yang Anda raba. Ini bisa diakali dengan before filter bila Anda senang berurusan dgn resourceful URL dan controller atau bisa juga Anda akali aja taroh callback before save di model yg Anda perlukan. selesai. > saya dapat error > The error occurred while evaluating nil.createdari error tersebut saya > rasa ada kesalah di > @user.address.create(params[:address])tapi saya ga tau harus gmn lagi. > mohon pencerahan teman-teman. > > Trims. http://www.ruby-lang.org/id
[id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
--- In id-ruby@yahoogroups.com, ANdreas Aditya wrote: > Kalo boleh sedikit usul gimana kalo tabel users dan addreses digabung jadi > satu tabel... biar ga redundant.. Nah menarik ;-)) penggunaan has one dari level data modelling, lalu sampai urusan desain database, hingga koding (baik dari hanya di model, atau hingga controller dan view yg berantakan) ini bisa jadi perdebatan panjang. Kalau saya bilang ya tergantung, jaman dulu ketika rails nggak kayak jaman tu poin eou sekarang sampai2x itu model diakali agar tidak bisa di mass assignment (alasannya macam2 dari lame sampe nyentil hacker suka mass assignment segalalah), trus kalo 2.0 bisa di config di environment yg diinginkan agar bisa ngupdate sesuai field yang diinginkan aja. singkat cerita ya tetap bergantung sikon, kalo user cuma punya dikit field sih gpp 1 doang, tapi kalo sampe pouanjang banyak banget ya boleh lah mau bikin pisah2x, trus tapi nanti musti pintar- pintar ngaturnya biar nggak gendut itu refer ada blog post bagus banget dari josh susser baru2x ini kalo kita sampe punya model file lebih dari 40 ato 50 biji gitu musti digimanain strateginya dst. selamat bersenang-senang sama ruby, semoga sukses. ;-) > @ndreas http://www.rubyflow.com
[id-ruby][Confused] Pembuktian Transaction Tidak Sesuai
Sebelumnya ada baiknya mengucap terimakasih kepada Ari dan Edwin yang sudah menolong di permasalah pertama tadi. Next, saya melakukan pembuktian transaction object pada Ruby on Rails : Sumarry: Saya membuka 2 windows DOS untuk membuktikan kebenaran transaction support di ruby on rails. Masing-masing windows memiliki time execution yang berbeda-beda. Berikut penjelasannya. --- Window DOS 1 --- F:\ruby\tiesto>ruby test/unit/barang_terpesan_test.rb Loaded suite test/unit/barang_terpesan_test Started . Finished in 42.078 seconds. 1 tests, 0 assertions, 0 failures, 0 errors --- Windows DOS 2 --- F:\ruby\project_dev>ruby test/unit/barang_terpesan_test.rb Loaded suite test/unit/barang_terpesan_test Started . Finished in 42.125 seconds. 1 tests, 0 assertions, 0 failures, 0 errors --- SCRIPT di barang_terpesan_test.rb --- require File.dirname(__FILE__) + '/../test_helper' class BarangTerpesanTest < Test::Unit::TestCase fixtures :barang_terpesans def test_what barang = BarangTerpesan.find(:first) BarangTerpesan.transaction do barang.proses_modifikasi end end end Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[id-ruby][Sharing-Versi Lengkap] Pembuktian Transaction Support
Sebelumnya ada baiknya mengucap terimakasih kepada Ari dan Edwin yang sudah menolong di permasalah pertama tadi. Next, saya melakukan pembuktian transaction object pada Ruby on Rails : Sumarry: Saya membuka 2 windows DOS untuk membuktikan kebenaran transaction support di ruby on rails. Masing-masing windows memiliki time execution yang berbeda-beda. Berikut penjelasannya. --- Window DOS 1 --- F:\ruby\tiesto>ruby test/unit/barang_terpesan_test.rb Loaded suite test/unit/barang_terpesan_test Started . Finished in 42.078 seconds. 1 tests, 0 assertions, 0 failures, 0 errors --- Windows DOS 2 --- F:\ruby\project_dev>ruby test/unit/barang_terpesan_test.rb Loaded suite test/unit/barang_terpesan_test Started . Finished in 42.125 seconds. 1 tests, 0 assertions, 0 failures, 0 errors --- SCRIPT di barang_terpesan_test.rb --- require File.dirname(__FILE__) + '/../test_helper' class BarangTerpesanTest < Test::Unit::TestCase fixtures :barang_terpesans def test_what barang = BarangTerpesan.find(:first) BarangTerpesan.transaction do barang.proses_modifikasi end end end -- SCRIPT di BarangTerpesan.rb (Active Record) -- class BarangTerpesan < ActiveRecord::Base def proses_modifikasi #dikasih delay for x in 1..1 end update_attributes(:jumlah => jumlah-1) end - KONDISI TABLE SEBELUM ACTION - -- ID | BARANG | JUMLAH | -- 1 | ABC01 | 10| -- Setelah kedua windows itu dijalankan, hasilnya : -- KONDISI TABLE SETELAH 2 EKSEKUSI BERSAMAAN -- -- ID | BARANG | JUMLAH | -- 1 | ABC01 | 9| -- Ini tidak sesuai dengan kaidah database seharusnya 10 - 1 -1 = 8, bukan 9. Padahal saya sudah menaro BarangTerpesan.transaction. Gimana teman-teman ada solusi atau saran? Thank You Reinhart http://teapoci.blogspot.com Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support
Dear All: I have done my test for 2 actions do simultaneously for the same command. Here is my approvement. Window DOS 1 F:\ruby\tiesto> ruby test/unit/item_test.rb Loaded suite test/unit/item_test Started . Finished in 42.078 seconds. 1 tests, 0 assertions, 0 failures, 0 errors Windows DOS 2 F:\ruby\tiesto>ruby test/unit/barang_ terpesan_ test.rb Loaded suite test/unit/barang_terpesan_ test Started . Finished in 42.125 seconds. 1 tests, 0 assertions, 0 failures, 0 errors - - - SCRIPT di barang_terpesan_test.rb - - - require File.dirname( __FILE__) + '/../test_helper' class BarangTerpesanTest < Test::Unit:: TestCase fixtures :barang_terpesans def test_what barang = BarangTerpesan. find(:first) BarangTerpesan. transaction do barang.proses_ modifikasi end end end - - - --- SCRIPT di BarangTerpesan. rb (Active Record) - - - --- class BarangTerpesan < ActiveRecord: :Base def proses_modifikasi #dikasih delay for x in 1..1 end update_attributes( :jumlah => jumlah-1) end - KONDISI TABLE SEBELUM ACTION - - - ID | BARANG | JUMLAH | - - 1 | ABC01 | 10 | - - Setelah kedua windows itu dijalankan, hasilnya : - - - - -- KONDISI TABLE SETELAH 2 EKSEKUSI BERSAMAAN - - - - -- - - ID | BARANG | JUMLAH | - - 1 | ABC01 | 9 | - - Ini tidak sesuai dengan kaidah database seharusnya 10 - 1 -1 = 8, bukan 9. Padahal saya sudah menaro BarangTerpesan. transaction. Gimana teman-teman ada solusi atau saran? Thank You Reinhart http://teapoci. blogspot. com Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Balasan: Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support
--- Booking Heaven <[EMAIL PROTECTED]> wrote: > Dear All: > > I have done my test for 2 actions do simultaneously for the same command. > Here is my approvement. > > > > > Window DOS 1 > > > F:\ruby\tiesto> ruby test/unit/item_test.rb > Loaded suite test/unit/item_test > Started > . > Finished in 42.078 seconds. > > 1 tests, 0 assertions, 0 failures, 0 errors > > > Windows DOS 2 > > > F:\ruby\tiesto>ruby test/unit/barang_ terpesan_ test.rb > Loaded suite test/unit/barang_terpesan_ test > Started > . > Finished in 42.125 seconds. > > 1 tests, 0 assertions, 0 failures, 0 errors > > - - - > SCRIPT di barang_terpesan_test.rb > - - - > dan apa isi test/unit/item_test.rb ? rgds, Edwin. Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/
Re: Balasan: Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support
Permasalahannya adalah database engine saya adalah MyISAM, pake MySQL 5.0 tapi saya coba berkali-kali konvert ke InnoDB gagal terus, saya ber inisiatif mengupgrade ke MySQL 5.1 dan berhasil masuk ke InnoDB, saya kemudian copy libMySQL.dll ke ruby/bin, dan hasilnya adalah : F:\ruby\tiesto>ruby script/server => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2008-05-09 05:14:02] INFO WEBrick 1.3.1 [2008-05-09 05:14:02] INFO ruby 1.8.5 (2006-08-25) [i386-mswin32] [2008-05-09 05:14:02] INFO WEBrick::HTTPServer#start: pid=3928 port=3000 127.0.0.1 - - [09/May/2008:05:14:35 SE Asia Standard Time] "GET / HTTP/1.1" 500 941 - -> / D:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_ adapters/mysql_adapter.rb:389: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. F:\ruby\tiesto> kok gak bisa-bisa yah? Saya dalam proses pembuktian Transaction Support untuk The Lost Updating and Uncommitted dependency. Terimakasih lagi Edwin. Reinhart http://teapoci.blogspot.com --- On Thu, 5/8/08, Edwin Pratomo <[EMAIL PROTECTED]> wrote: From: Edwin Pratomo <[EMAIL PROTECTED]> Subject: Balasan: Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support To: id-ruby@yahoogroups.com Date: Thursday, May 8, 2008, 12:59 PM --- Booking Heaven wrote: > Dear All: > > I have done my test for 2 actions do simultaneously for the same command. > Here is my approvement. > > > > - --- > Window DOS 1 > - --- > > F:\ruby\tiesto> ruby test/unit/item_ test.rb > Loaded suite test/unit/item_ test > Started > . > Finished in 42.078 seconds. > > 1 tests, 0 assertions, 0 failures, 0 errors > > - --- > Windows DOS 2 > - --- > > F:\ruby\tiesto> ruby test/unit/barang_ terpesan_ test.rb > Loaded suite test/unit/barang_ terpesan_ test > Started > . > Finished in 42.125 seconds. > > 1 tests, 0 assertions, 0 failures, 0 errors > > - - - > SCRIPT di barang_terpesan_ test.rb > - - - > dan apa isi test/unit/item_ test.rb ? rgds, Edwin. _ _ _ _ Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers. yahoo.com/ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: Balasan: Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support
Akhirnya saya install xamp yang ada phpmysqlna dan akhirnya bisa berjalan dengan meng copy paste libmysql.dll ke ruby bin (yang punya xamp), permasalahan lainnya adalah di unit test apapun yang saya lakukan seperti CRUD, tidak mempengaruhi kondisi data value di attributnya. Misal saya mo update stock 10 jadi 9, semua berjalan dengan baik gak ada pesan error tapi hasilnya tetap 10 (bukan suatu kejadian concurrent tapi ini sigle action). Kenapa yah? Reinhart http://teapoci. blogspot. com --- On Thu, 5/8/08, Booking Heaven <[EMAIL PROTECTED]> wrote: From: Booking Heaven <[EMAIL PROTECTED]> Subject: Re: Balasan: Re: [id-ruby][CORRECTION Lengkap] Pembuktian Transaction Support To: id-ruby@yahoogroups.com Date: Thursday, May 8, 2008, 6:04 PM Permasalahannya adalah database engine saya adalah MyISAM, pake MySQL 5.0 tapi saya coba berkali-kali konvert ke InnoDB gagal terus, saya ber inisiatif mengupgrade ke MySQL 5.1 dan berhasil masuk ke InnoDB, saya kemudian copy libMySQL.dll ke ruby/bin, dan hasilnya adalah : F:\ruby\tiesto> ruby script/server => Booting WEBrick... => Rails application started on http://0.0.0. 0:3000 => Ctrl-C to shutdown server; call with --help for options [2008-05-09 05:14:02] INFO WEBrick 1.3.1 [2008-05-09 05:14:02] INFO ruby 1.8.5 (2006-08-25) [i386-mswin32] [2008-05-09 05:14:02] INFO WEBrick::HTTPServer #start: pid=3928 port=3000 127.0.0.1 - - [09/May/2008: 05:14:35 SE Asia Standard Time] "GET / HTTP/1.1" 500 941 - -> / D:/ruby/lib/ ruby/gems/ 1.8/gems/ activerecord- 1.15.3/lib/ active_record/ connection_ adapters/mysql_ adapter.rb: 389: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application' s support team for more information. F:\ruby\tiesto> kok gak bisa-bisa yah? Saya dalam proses pembuktian Transaction Support untuk The Lost Updating and Uncommitted dependency. Terimakasih lagi Edwin. Reinhart http://teapoci. blogspot. com Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
Memang desain table dimasalah saya redundant, tapi ini cuma test case yang saya coba selesaikan. Masalah saya kemarin mungkin banyakj ditemui sama rails-noob macam saya :) Solusinya jadi gini : class Address < ActiveRecord::Base has_one :province belongs_to :user ... class Province < ActiveRecord::Base belongs_to :country belongs_to :address ... class User < ActiveRecord::Base has_one :address, :dependent => :destroy ... class UserController < ApplicationController ... def create @user = User.new(params[:user]) @address = @user.create_address(params[:address]) if @user.save redirect_to :action => 'list' else render :action => 'new' end end ... sekarang masalahnya kalo mau update gmn? :( tolongin yah
Re: [id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
imho, untuk update: @user = User.find(params[:id]) @user.first_name = "Nizham" @user.last_name = "Tanjung" if @user.save . Tapi (demi simplicity 'n malesity), kenapa nggak pake ./script generate scaffold ajah? kan udah otomatis CRUD nya. - Original Message From: d0a98042 <[EMAIL PROTECTED]> To: id-ruby@yahoogroups.com Sent: Friday, May 9, 2008 10:25:12 AM Subject: [id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel Memang desain table dimasalah saya redundant, tapi ini cuma test case yang saya coba selesaikan. Masalah saya kemarin mungkin banyakj ditemui sama rails-noob macam saya :) Solusinya jadi gini : class Address < ActiveRecord: :Base has_one :province belongs_to :user ... class Province < ActiveRecord: :Base belongs_to :country belongs_to :address ... class User < ActiveRecord: :Base has_one :address, :dependent => :destroy ... class UserController < ApplicationControll er ... def create @user = User.new(params[ :user]) @address = @user.create_ address(params[ :address] ) if @user.save redirect_to :action => 'list' else render :action => 'new' end end ... sekarang masalahnya kalo mau update gmn? :( tolongin yah Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ [Non-text portions of this message have been removed]
Re: [id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
@user = User.find(params[ :id]) @user.update_attributes(:first_name=>"Reinhart",:last_name=>"Teapoci") Nice!! Reinhart http://teapoci.blogspot.com --- On Thu, 5/8/08, muhammad nizham <[EMAIL PROTECTED]> wrote: From: muhammad nizham <[EMAIL PROTECTED]> Subject: Re: [id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel To: id-ruby@yahoogroups.com Date: Thursday, May 8, 2008, 8:52 PM imho, untuk update: @user = User.find(params[ :id]) @user.first_ name = "Nizham" @user.last_name = "Tanjung" if @user.save . Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
[id-ruby] Re: [Rails] Masalah dengan 1 form yang menambah row di 2 tabel
Makasih semuanya! masalah saya selesai :) def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) && @user.address.update_attributes(params[:address]) redirect_to :action => 'list' else @provinces = Province.find(:all) @countries = Country.find(:all) render :action => 'edit' end end