Search the web
Sign In
New User? Sign Up
id-ruby · Komunitas Pengguna Ruby Indonesia
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Prioritas resources   Message List  
Reply | Forward Message #4422 of 5617 |
Re: [id-ruby] Re: Prioritas resources

Adinda Praditya wrote:

> saya sudah restart servernya setelah menambahkan
> action upload_file di routes.rb.

> 2008/8/27 Adinda Praditya <apraditya@...>

>> Ini routes.rb saya:
>>
>> map.resources :speeches, :collection => {
>> :upload_file => 'get'
>> }
>> map.resources :speeches
>>
>> Dan saya sudah konfirmasi melalui rake routes
>>
>> $ rake routes|grep speech
>> upload_file_speeches GET
>> /speeches/upload_file {:controller=>"speeches",
>> :action=>"upload_file"}
>> formatted_upload_file_speeches GET
>> /speeches/upload_file.:format {:controller=>"speeches",
>> :action=>"upload_file"}
>> GET
>> /speeches {:controller=>"speeches",
>> :action=>"index"}
>>
>> Mengapa saya masih dapat error RecordNotFound saat mengakses
>> http://localhost:3000/speeches/upload_file ?

Karena Anda tidak menyertakan ID dari Record yang diinginkan, sehingga
Active Record otomatis raise ActiveRecord::RecordNotFound Exception.

clue1: perhatikan bedanya :collection sama :member ya.

clue2: perhatikan apakah sdh ada callback yg panggil itu record.

kalau setelah clue1 dan clue2 sudah juga diperiksa dan sudah pasti
benar, silakan report lagi kesini.

http://ariekeren.blogdetik.com
"Don't ask if you can ask, just ask!", R2D2



Wed Aug 27, 2008 9:55 am

riyari3
Offline Offline
Send Email Send Email

Forward
Message #4422 of 5617 |
Expand Messages Author Sort by Date

Hi all, Karena Rails 2.x akan lebih REST, maka resources harus diperhatikan / diurus. Ini routes.rb saya: map.resources :speeches, :collection => { ... } ...
Adinda Praditya
pradity
Offline Send Email
Aug 27, 2008
5:36 am

Maaf, sekedar tambahan, saya sudah restart servernya setelah menambahkan action upload_file di routes.rb. Thanks, Dida 2008/8/27 Adinda Praditya...
Adinda Praditya
pradity
Offline Send Email
Aug 27, 2008
5:38 am

... Karena Anda tidak menyertakan ID dari Record yang diinginkan, sehingga Active Record otomatis raise ActiveRecord::RecordNotFound Exception. clue1:...
Arie Kusuma Atmaja
riyari3
Offline Send Email
Aug 27, 2008
9:55 am

2008/8/27 Arie Kusuma Atmaja <ariekusumaatmaja@...> ... Memang bedanya apa? Baca dari API doc nggak terlalu jelas bedanya apa. ... Sebenarnya yang saya...
Adinda Praditya
pradity
Offline Send Email
Aug 27, 2008
10:23 am

Agak telat kali yah jawabannya tapi moga-moga membantu :) ... Iyah, dengan declare: map.resources :speeches, :collection => { ... } Anda sebenernya sudah...
Leo Laksmana
leo_beol
Online Now Send Email
Sep 16, 2008
12:28 pm

Gpp mas, makasih banyak Dida 2008/9/16 Leo Laksmana <beol@...> ... [Non-text portions of this message have been removed]...
Adinda Praditya
pradity
Offline Send Email
Sep 17, 2008
1:41 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help