Ruby on Rails Wednesday, January 27, 2016

Mike S. wrote in post #1180984:
> In the delete link, you need to use the delete method-Rails now expects
> a delete verb, where as your code is generating a get I believe
>
> So
>
>> <%= link_to 'Delete', :controller => "people", :action
>> => "destroy", :id => e, :method => :delete %>
>
>
>
> Sent from my iPhone

I have the changes and it just directs me to the show page displaying
the info like before. When I go back to /people the data is still there.
In the logs it says:

Started GET "/people/1?method=delete" for ::1 at 2016-01-27 17:38:42
-800
Processing by PeopleController#show as HTML
Parameters: {"method" => "delete", "id" => "2"}
Person Load (0.5ms) SELECT "people".* FROM "people" WHERE "people"."id"
= $1 LIMIT 1 [["id", 2]]
Rendered people/show.html.erb within layouts/application (0.0ms)
Completed 200 OK in 26ms (views: 25.0 ms | ActiveRecord :0.5 ms)

...

Started GET "/stylesheets/default.css" for ::1 at ..

...

Started GET "/javascripts/default.js" for ::1 at ..


I did some searching and I was wondering if it is the javascript because
I changed the application.html.erb from

<%= stylesheet_link_tag 'application'
<%= javascript_include_tag 'application'

and replaced 'application' to 'default' since I am on windows and the
'application' was causing problems

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/333623f4c1f2f74c51c21683ef97854d%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment