Hi, I think you're in the wrong group. This group is for Prototype stuff, you're probably looking for the Ruby group: http://groups.google.com/group/rubyonrails-talk -- T.J. Crowder tj / crowder software / com
On Apr 29, 7:54 pm, RoR_N <[EMAIL PROTECTED]> wrote: > I'm trying to delete an account but at the same time i'd like to > delete the portals that belongs to the account. > This is what i wrote but it's not working. > how can i deal with this problem? > > I have this code inside the account controller in the "destroy" method > def destroy > @account = Account.find(params[:id]) > @portal = Portal.find(:all, :conditions => ['account_id = ?', > @account.id ]) > @portal.destroy > @account.destroy > end > any ideas? > > the error displays this: > > NoMethodError in AccountsController#destroy > > undefined method `destroy' for #<Array:0x47982a0> > app/controllers/accounts_controller.rb:78:in `destroy' > Request > > Parameters: > > {"_method"=>"delete", > "authenticity_token"=>"f8c32ed76159e1b51b0883ef72a4ab801b92d322", > "id"=>"11"} --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---