My rails 3 app is working fine except for resource deletion which uses
ajax.
The resource is “part”.
When the user clicks on the “delete part” link, a confirmation pop up
box will appear.
Upon clicked on “ok”, an ajax request is fired to the ‘delete’ method
in my controller.
In the “parts” controller, I have a before_filter which points to a
method
which checks if the current user has authorisation to delete the given
part entry.
This method works fine for my other methods specified in the
before_filter but doesn’t for the deletion method.
My rails 3 app is working fine except for resource deletion which uses
ajax.
The resource is “part”.
When the user clicks on the “delete part” link, a confirmation pop up
box will appear.I’ve done some extra checks and observed that with Javascript
turned off on my web browsers (chrome and firefox),
the destroy method does not get called when I click on it.
in app/views/parts/index.html.erb, i observed that I was using
“:method => delete”
to generate the deletion link.
I have changed it to use ‘data-method’=> :delete but it still does not
work
link_to 'Delete',
part_path(part.id),
:method => :delete,
'data-confirm' => 'Are you
I’ve done some extra checks and observed that with Javascript turned
off on my web browsers (chrome and firefox),
the destroy method does not get called when I click on it.
in app/views/parts/index.html.erb, i observed that I was using
“:method => delete”
to generate the deletion link.
I have changed it to use ‘data-method’=> :delete but it still does not
work
link_to 'Delete',
part_path(part.id),
:method => :delete,
'data-confirm' => 'Are you