Hey all, well I have a delete function in my rails application that
works successfully. When I click the button it deletes the record from
the page as well as the database, my problem is that I don''t want it to
instantaneously do this, I want it to give the user the option to cancel
before hand. How would I do this. My code for the button is as followed:
_form.html.erb/games
<%= f.submit %>
<%= button_to ''Destroy'', root_url, :confirm =>
''Sure?'', :method =>
:delete %>
Application.html.erb
<head>
<title>Wishlist</title>
<%= stylesheet_link_tag "/stylesheet/style", :media =>
"all"%>
<%= javascript_include_tag :all %>
<%= csrf_meta_tags %>
</head>
Anything I am missing?
--
Posted via http://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Mine work fine here, what rails version did you use. Im using 3.2 here, make sure that the page include: <script src="/assets/jquery_ujs.js?body=1<http://localhost:3000/assets/jquery_ujs.js?body=1>" type="text/javascript"></script> or something similar. Ahmy Yulrizka On Tue, Feb 14, 2012 at 12:28 AM, Christopher Jones <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> <%= button_to ''Destroy'', root_url, :confirm => ''Sure?'', :method => > :delete %> >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 14, 2012 at 5:49 AM, Ahmy Yulrizka <ahmy135-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Mine work fine here, what rails version did you use. > > Im using 3.2 here, make sure that the page include: > > <script src="/assets/jquery_ujs.js?body=1<http://localhost:3000/assets/jquery_ujs.js?body=1>" > type="text/javascript"></script> > >Regarding the asset pipeline, I think it is better to write <%= javascript_include_tag "application" %> so that the application will also correctly use the MD5 fingerprinted names in production. I would avoid writing the src url manually and always use the javascript_include_tag. HTH, Peter -- *** Available for a new project *** Peter Vandenabeele http://twitter.com/peter_v http://rails.vandenabeele.com http://coderwall.com/peter_v -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> <%= javascript_include_tag "application" %>That line worked great Pete, It is all sorted now. Just wondering why it works with the "application" and not the :all? Thanks. -- Posted via http://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.