Getting errors in cached environment on destroy

I have a project that is having some issues in clearing cache files in
any environment that allows for data caching.

This is the error that I am getting:
ArgumentError in Admin/pagesController#destroy

wrong number of arguments (1 for 0)
RAILS_ROOT: /Users/chris/Documents/Projects/Rails/app

Application Trace | Framework Trace | Full Trace
after_destroy' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/observer.rb:157:insend’
update' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:338:innotify’
callback' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:296:indestroy_without_transactions’
destroy' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:intransaction’
transaction' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:intransaction’
destroy' app/controllers/admin/pages_controller.rb:41:indestroy’

Here is my controller code:

class Admin::PagesController < ApplicationController
before_filter :login_required_for_staff_member, :find_account
layout “admin”

def destroy
@page = @account.pages.find(params[:id])
if @page.destroy
flash[:success] = “The page was deleted”
redirect_to admin_pages_url
render :action => “index”

Any ideas?

Thanks for the help.

Show us your model code please, specificially whatever is calling

On Thu, May 22, 2008 at 6:07 AM, Chris O. <
[email protected]> wrote:

Application Trace | Framework Trace | Full Trace

@page = @account.pages.find(params[:id])
Thanks for the help.

Posted via

Appreciated my help?
Recommend me on Working With Rails

Unfortunately, there is nothing that is being called in the after
destroy and I don’t see anything in the acts_as_paranoid that would
cause the problem.

class Page < ActiveRecord::Base
belongs_to :account
has_many :contents
has_many :current_contents, :class_name => “Content”, :conditions =>
‘expires = false or expires_on > “#{}”’, :order => “id desc”
has_many :expired_contents, :class_name => “Content”,:conditions =>
‘expires = true and expires_on < “#{}”’, :order => “id desc”

validates_presence_of :name


def to_param
“#{id}-#{name.gsub(”\s", “_”)}"


:slight_smile: There was a different sweeper that was calling the after_destroy
method. I missed that one.

Thanks for the help Ryan.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs