hi
i have a link in a view to delete a user:
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
hi
i have a link in a view to delete a user:
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
Adel M. <mediouni.adel@…> writes:
hi
i have a link in a view to delete a user:<%= link_to 'Destroy', {:controller => :users, :action => :destroy, :id => user}, :confirm => 'are you sure !' %> all works good,when i click to delete user its ok, just i dont have
Do you have the javacript libraries loaded?
Hi!
I’m new to Rails and on the list, but I’ll try to help.
I think you should write:
<%= link_to 'Destroy', {:controller => :users, :action > => :destroy, :id => user, :confirm => 'are you sure !' } %>…I think you should change the curly braces.
Everaldo
On 20 June 2011 04:27, Adel M. [email protected] 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?
/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 H. [email protected]
You received this message because you are subscribed to the Google G.
“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.
–
Mediouni Adel
Tunis
i dont like kitchen so to mix is not realy my hobbie
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 H. [email protected]
this
:onclick => “return delete_record("#{race.display_name}");” %>
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
–
Mediouni Adel
Tunis
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.
hi,
try
<%= link_to 'Destroy, user_path(@user), :method=>:delete, :confirm
=>‘are you sure?’%>
tom
On Jun 20, 2011, at 10:54 , Adel M. wrote:
=> :destroy, :id => user, :confirm => ‘are you sure !’ } %>
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.
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
On 20 June 2011 11:03, Adel M. [email protected] wrote:
i dont like kitchen
so to mix is not realy my hobbie
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 thanksover all.
Also install the Firebug addin to Firefox and try it. Firebug will
give you information about javascript errors.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs