The standard delete link created by scaffold is
<%= link_to 'Destroy', question, :confirm => 'Are you
sure?', :method => :delete %>
There is no reference to remote. Delete is not an ajax call, it is
just a javascript call that hides all the build a delete form stuff
that happened in Rails 2.x. By putting in :remote, it was probably
trying to do an Unobtrusive Javascript call to an unknown method. I
think!!!
If you are just trying to replace the delete link on the Apple demo,
try the above line.
Steve
On Oct 15, 8:40 am, David Weldon <[email protected]> wrote:
> Thanks for the quick response, Steve. The rails.js file is in the
> public/javascripts and it can be seen in the source of my page:
>
> <script src="/javascripts/rails.js?1285525822"
> type="text/javascript"></script>
>
> The link that is generated by the call to link_to is:
>
> <a
> href="/events/4?remote=true&method=delete&confirm=Are+you+sure%3F&a
> mp;url=http%3A%2F%2Flocalhost%3A3000%2Fevents%2F4%2Fexpenses%2F6">delete</a >
>
> Which mentions remote=true, but doesn't appear to make any reference to
> javascript.
>
> I made a successful Ajax call in the prior part of the tutorial, only
> this time with the following syntax:
>
> <%= form_for [...@event, @expense], :remote => true do |f| -%>
>
> --
> Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.