Problem with controller loosing an id

Hey there, i am trying to set a site by the site_id of one of its
children, i think that after i destroy the child it looses the site i
am trying to create, the following code gives me an error about
couldn’t find site with id=0

<%= link_to 'Destroy', { :action => 'destroy', :id => site_note }, :confirm => 'Are you sure?', :post => true %>

def destroy
@site_note = SiteNote.find(params[:id])
@site = Site.find(@site_note.site_id)
@site_note.destroy
redirect_to :action => ‘list’, :id => @site
end

any ideas ?

sk

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