hi i have a link in a view to delete a user: <td><%= link_to ''Destroy'', {:controller => :users, :action => :destroy, :id => user}, :confirm => ''are you sure !'' %></td> all works good,when i click to delete user its ok, just i dont have the alert ''are you sure !'' i dont know why! please can you help me. thanks -- 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.
Adel Mediouni <mediouni.adel@...> writes:> > hi > i have a link in a view to delete a user: > <td><%= link_to ''Destroy'', {:controller => :users, :action > => :destroy, :id => user}, :confirm => ''are you sure !'' %></td> > > all works good,when i click to delete user its ok, just i dont haveDo you have the javacript libraries loaded? -- 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.
Hi! I''m new to Rails and on the list, but I''ll try to help. I think you should write: <td><%= link_to ''Destroy'', {:controller => :users, :action> => :destroy, :id => user, :confirm => ''are you sure !'' } %></td>....I think you should change the curly braces. http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to Everaldo On Sun, Jun 19, 2011 at 10:16 PM, Andrew Skegg <andrewskegg-BUHhN+a2lJ4@public.gmane.org> wrote:> Adel Mediouni <mediouni.adel@...> writes: > > > > > hi > > i have a link in a view to delete a user: > > <td><%= link_to ''Destroy'', {:controller => :users, :action > > => :destroy, :id => user}, :confirm => ''are you sure !'' %></td> > > > > all works good,when i click to delete user its ok, just i dont have > > > > Do you have the javacript libraries loaded? > > -- > 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. > >-- 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.
i load all js. 2011/6/20 Andrew Skegg <andrewskegg-BUHhN+a2lJ4@public.gmane.org>> Adel Mediouni <mediouni.adel@...> writes: > > > > > hi > > i have a link in a view to delete a user: > > <td><%= link_to ''Destroy'', {:controller => :users, :action > > => :destroy, :id => user}, :confirm => ''are you sure !'' %></td> > > > > all works good,when i click to delete user its ok, just i dont have > > > > Do you have the javacript libraries loaded? > > -- > 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. > >-- Mediouni Adel Tunis www.metal-tn.xooit.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.
i try it, always the same probleme :s 2011/6/20 Everaldo Gomes <everaldo.gomes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> Hi! > > I''m new to Rails and on the list, but I''ll try to help. > > I think you should write: > > <td><%= link_to ''Destroy'', {:controller => :users, :action > > => :destroy, :id => user, :confirm => ''are you sure !'' } %></td> > > ....I think you should change the curly braces. > > > http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to > > Everaldo >-- 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 20 June 2011 04:27, Adel Mediouni <mediouni.adel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i load all js.However you need to have the default js libraries that were installed when you created the project in the first place. If you have removed any of controls.js, dragdrop.js, effects.js or prototype.js then it might not work. What is the contents of you public/javascript directory? -- 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.
/public/javascripts/active_scaffold /public/javascripts/codebase /public/javascripts/vendor /public/javascripts/widgets /public/javascripts/apiconsole.js /public/javascripts/application.js /public/javascripts/aspect-contacts.js /public/javascripts/aspect-edit.js /public/javascripts/aspect-edit-pane.js /public/javascripts/aspect-filters.js /public/javascripts/contact-list.js /public/javascripts/custom-mobile-scripting.js /public/javascripts/diaspora.js /public/javascripts/fileuploader-custom.js /public/javascripts/friend-finder.js /public/javascripts/ie.js /public/javascripts/inbox.js /public/javascripts/infinite_scroll.js /public/javascripts/jquery.autocomplete-custom.js /public/javascripts/jquery.js /public/javascripts/keycodes.js /public/javascripts/menu.js /public/javascripts/mobile.js /public/javascripts/photo-show.js /public/javascripts/prototype.js /public/javascripts/publisher.js /public/javascripts/rails.js /public/javascripts/search.js /public/javascripts/sorttable.js /public/javascripts/stream.js /public/javascripts/validation.js /public/javascripts/view.js /public/javascripts/web-socket-receiver.js 2011/6/20 Peter Hickman <peterhickman386-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 20 June 2011 04:27, Adel Mediouni <mediouni.adel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > i load all js. > > However you need to have the default js libraries that were installed > when you created the project in the first place. If you have removed > any of controls.js, dragdrop.js, effects.js or prototype.js then it > might not work. What is the contents of you public/javascript > directory? > > -- > 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. > >-- Mediouni Adel Tunis www.metal-tn.xooit.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.
Ok you have pretty much everything and the kitchen sink in there. This is what *might* be happening. I have found that jquery and prototype conflict and have had to handle this with my own code. Well for us jquery and prototype were conflicting, it could be for you as well. // We are using jQuery which does not support the :confirm => ''...'' option of the // link_to and button_to tags. However if we also load the prototype js library // things seem to go wrong with the existing js code so we have to handle this function delete_record(message) { var r = confirm("Do you want to delete " + message + "?"); return r; } and you use it with <%= link_to ''Delete this race'', race_delete_url(:id => race.id), :onclick => "return delete_record(\"#{race.display_name}\");" %> This should at least get you out of the hole. However mixing javascript libraries is not a good idea. -- 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.
i dont like kitchen :p so to mix is not realy my hobbie :D i try to develop an applcation based on the project Diaspora, so i''m adding some views and controller in the diaspora project. its why i have all these lib. any way, im going to try your soulution. and thanks over all. 2011/6/20 Peter Hickman <peterhickman386-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> Ok you have pretty much everything and the kitchen sink in there. This > is what *might* be happening. I have found that jquery and prototype > conflict and have had to handle this with my own code. Well for us > jquery and prototype were conflicting, it could be for you as well. > > // We are using jQuery which does not support the :confirm => ''...'' > option of the > // link_to and button_to tags. However if we also load the prototype js > library > // things seem to go wrong with the existing js code so we have to handle > this > > function delete_record(message) { > var r = confirm("Do you want to delete " + message + "?"); > > return r; > } > > and you use it with > > <%= link_to ''Delete this race'', race_delete_url(:id => race.id), > :onclick => "return delete_record(\"#{race.display_name}\");" %> > > This should at least get you out of the hole. However mixing > javascript libraries is not a good idea. > > -- > 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. > >-- Mediouni Adel Tunis www.metal-tn.xooit.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.
On 20 June 2011 11:03, Adel Mediouni <mediouni.adel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i dont like kitchen :p so to mix is not realy my hobbie :D > i try to develop an applcation based on the project Diaspora, so i''m adding > some views and controller in the diaspora project. > its why i have all these lib. > any way, im going to try your soulution. and thanksĀ over all.Also install the Firebug addin to Firefox and try it. Firebug will give you information about javascript errors. Colin -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hi, try <%= link_to ''Destroy, user_path(@user), :method=>:delete, :confirm =>''are you sure?''%> tom On Jun 20, 2011, at 10:54 , Adel Mediouni wrote:> i try it, always the same probleme :s > > 2011/6/20 Everaldo Gomes <everaldo.gomes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Hi! > > I''m new to Rails and on the list, but I''ll try to help. > > I think you should write: > > <td><%= link_to ''Destroy'', {:controller => :users, :action > > => :destroy, :id => user, :confirm => ''are you sure !'' } %></td> > > ....I think you should change the curly braces. > > http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to > > Everaldo > > -- > 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.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- 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.