Delete link in Rails 3

Closing in steadily on my Rails 3 upgrade. I can see the finish line.
A few more wrinkles to iron out.

My Rails app uses jQuery and Haml. I downloaded the rails.js and put it
in my application.html.haml as I show below:


%html{:lang => "en"}




      The Internet File Manager

    = stylesheet_link_tag 'web_app_theme',
"themes/#{@current_theme}/style", 'web_app_theme_ext','ui.theme.css',
'ui.core.css', 'ui.accordion.css','jquery.cluetip.css'

    = javascript_include_tag "jquery.js", "rails.js", "jquery-ui.js",
"jquery.hoverIntent.js", "jquery.cluetip.js", "application.js"

    = csrf_meta_tag



The delete link has the usual code:

= link_to 'Delete', {:controller => controller_name, :action =>
'destroy', :id =>} , :confirm => 'Are you sure?', :method =>

This is generic code where I pass-in the controller name.

This does not do what it is supposed to instead takes me to the show
action as shown below:

Template is missing

Missing template clients/show with {:handlers=>[:erb, :rjs, :builder,
:rhtml, :rxml, :haml], :formats=>[:html], :locale=>[:en, :en]} in view
paths "/home/bruparel/rr_work/file_manager/app/views",

I am not sure how to attack this one?

Thanks in advance for your help.


check your app/config/routes.rb (with precedence)


Hello Thani,
I tried that, but no luck. The edit link that goes with delete link
works fine. It is shown below:

= link_to 'Edit', :controller => controller_name, :action => 'edit', :id

Corresponding routes.rb file snippet is shown below:
  resources :clients do
    member do
      get :set_current_client

It seems to me that it has something to do with unobstrusive jQuery
interaction with HTML 5 forms since the only link that misbehaves is the
delete/destroy link?

Please disregard.
It turns out that I was using the wrong rails.js file with jQuery plus
the wrong version of jQuery. Please watch the latest RailsCast from
Ryan Bates to get around this problem.