Home > Not Working > Rails Link_to Method Delete Not Working

Rails Link_to Method Delete Not Working

Contents

The data-method="delete" actually works as expected. What's the output you're getting in your server logs? lolhttp://www.themodestrubyist.com/2010/02 … meta-tags/ Learning rails, one day at a time.http://keilmiller.com tuscanidream's Website 20 Reply by Mulasse 2011-02-17 06:29:42 Mulasse From: Lyon Registered: 2011-01-04 Posts: 342 Re: link_to with :method=>:delete not working Join them; it only takes a minute: Sign up rails 4, link_to not working with destroy action when jquery, jquery_ujs is required up vote 6 down vote favorite How come the http://ariseoo.com/not-working/rails-confirm-delete-not-working.html

more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Any suggestions to solve this? What should I pack for an overland journey in a Bronze Age? I also verified that the following line is in my application view: <%= javascript_include_tag :all %> One thing I didn't quite understand, and it's probably the source of my problem: where

Rails Link_to Method Delete Not Working

Is there any algorithm combining classification and regression? You have to do it manually for a 3.0 app. Draw diagonal lines of text Why would you compare 'A' with 0x41? Join them; it only takes a minute: Sign up ruby on rails link_to delete method not working up vote 6 down vote favorite 1 I am trying to delete a post

  • more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation
  • That should give you the basic CRUD routing.
  • Join them; it only takes a minute: Sign up Rails' link_to method: GETing when it should DELETE up vote 24 down vote favorite 4 I'm following Michael Hartl's Rails Tutorial, and
  • What happens when you click the link? –polarblau Jan 7 '12 at 20:29 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted The whole head
  • Hot Network Questions Storing passwords in access-restricted Google spreadsheets?
  • All the includes were set correctly.
  • Browse other questions tagged javascript ruby-on-rails ruby-on-rails-3 or ask your own question.
  • But even if I change the link_to to :method => :destroy, it just issues a GET.
  • This is the delete link which supposed to work: <%= link_to "delete", user, :method => :delete, :confirm => "You sure?", :title => "Delete #{user.name}" %> But when I mouseover I see

I want to shutdown multiple Macs everyday at 23:30 (11:30 pm)? here's the straight button_to version:button_to t('general.delete'), :question_path(question), :method => :delete, :confirm => t('question.confirm_delete'), :title => t('question.delete_question') Last edited by Max Williams (2010-04-19 10:39:42) ############################################If i've helped you then please recommend me share|improve this answer answered Oct 16 '13 at 4:40 Peter Goldstein 3,3512814 add a comment| up vote 0 down vote application.js is a manifest file so the syntax is suppose to Rails Post Delete button_to allows you to create a form using put, post, and delete without enabling javascript. –Ryan Waits Oct 16 '13 at 4:55 You can also use data-method=delete instead of

Female has wings while male does not Why do governments not execute or otherwise permanently contain super villains? Any ideas? The only thing I was pointing out was that using $jQ didn't work for me. –marimaf May 7 '12 at 16:19 looks like my fault, I misstyped the variable My boss asks me to stop writing small functions and do everything in the same loop Draw diagonal lines of text Which security measures make sense for a static web site?

ruby-on-rails ruby-on-rails-3 share|improve this question edited Jan 19 '12 at 4:48 qiao 10.3k23944 asked Jan 7 '12 at 18:00 user1136228 375415 Why is most of the layout commented out? No Route Matches [delete] This entry was posted in tech and tagged jquery, rails. Munchkin: Charity: Giving cards to someone who has 5 already What Russian letter is this? Texas, USA speed ticket as a European citizen, already left the country How to improve player engagement in video call for virtual tabletop game?

Rails 4 Link_to Method Delete Not Working

first the confirm does not show and second i am not sure if the link_to even reaches the destroy action... Tag lines "Just do it" and "It just works" come to mind. Rails Link_to Method Delete Not Working Subscribed! Rails Destroy Not Working more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

layout head: Līvu pamatskola <%= stylesheet_link_tag 'style' %> <%= javascript_include_tag :defaults %> <%= csrf_meta_tag %> SOLVED: Found solution on this post: Rails 3.1 link_to not this contact form How to replace 8-sided dice with other dice Is total distance walked specific to a single Pokémon, or to a species of Pokémon? Somehow I got ascii 160 instead ascii 32 (the whitespace character). more hot questions question feed lang-rb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Data Method Delete Not Working

up vote 2 down vote favorite 2 I am practicing this RoR tutorial project of Michael Hartl: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book I am using Ruby 1.9.2 and Rails 3.1 on Ubuntu 11.04 with Apache On the same RoR project the follow/unfollow button using Ajax works just fine (can't post a second link here for now because I just registered to the SO). In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms have a peek here Browse other questions tagged ruby-on-rails-3.1 user railstutorial.org link-to or ask your own question.

What specifically did Hillary Clinton say or do, to seem untrustworthy to Americans? Jquery_ujs It ONLY works inside a comment. Instead of link_to, you could try to use button_to which creates a form allowing put, post and delete methods without Javascript enabled.

The link_to method will fallback any method (post, put and delete) to get (corresponding to the show action) when : Javascript has been disabled by the user for some reason, Rails

Not the answer you're looking for? I'm sure how it happen but copy and paste it again is working fine now. Browse other questions tagged ruby-on-rails ruby-on-rails-3 or ask your own question. Rails Button_to What is the word for when someone is overly nice and actually isnt nice at all?

Rails uses the Javascript driver to replace the HTTP verb. I used a solution that I happened to already have on my laptop on an exam. I don't get any confirmation window and no action is done (delete). Check This Out Is the rails.js file included in the application layout file?

The presence of a comment of the form //= require jquery instructs the preprocessor to include that file when building the application.js as served up to clients of the application. Linked 4 Rails 3.1 link_to not showing confirmation or destroying properly Related 59link_to method and click event in Rails116Ruby: delete multiple hash keys0Posting to controller via link_to1Using post with link_to1Ruby on Required fields are marked * Name * Email * Website Comment You may use these HTML tags and attributes:

Lab colleague uses cracked software.

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed root :to => 'index#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: Join them; it only takes a minute: Sign up Rails 3.1 link_to not showing confirmation or destroying properly up vote 4 down vote favorite I've been plowing through the chapters at share|improve this answer answered Nov 25 '12 at 21:57 Musaffa 386310 this seems to be answering a different question –Mild Fuzz Feb 24 '13 at 22:27 add a comment|

I'm using Rails 3.1. share|improve this answer edited Feb 13 '15 at 0:47 Ram 2,21092143 answered Feb 13 '15 at 0:08 Hien Luong 184110 1 If you don't want to include JQuery, switching link_to Did I cheat? Wilson Jan 5 '11 at 17:23 Is JavaScript enabled?

In case you've not used I18n before, the t("...") stuff is just calls to a translation table and could be replaced with hard coded strings for the purpose of this illustration:button_to_remote my problem is not the alert thing but the fact that it doesn't delete the post... Stick a print line in or something? –Jergason Sep 19 '11 at 18:21 2 Thanks-- your response helped me find the keywords to find this post, which has a solution Browse other questions tagged ruby-on-rails-3 httpverbs or ask your own question.

Optimizing number of IF-Else statements Do n and n^3 have the same set of digits? javascript ruby-on-rails ruby-on-rails-3 share|improve this question edited Jun 2 '13 at 18:42 Andrew Barber 30k1366102 asked Oct 16 '11 at 20:08 MiG 1815 Maybe @mhartl stackoverflow.com/users/57750/mhartl can answer to it simply does a GET –fxuser Oct 21 '12 at 12:32 Well it shouldn't be doing a get. Hot Network Questions How can Average Joe create a micro-state that is a member of the UN in the least amount of time?

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed