Ruby on Rails Thursday, January 28, 2016

I assume therefore you also renamed the /app/assets/javascripts/application.js to default.js

sorry I do not develop under Windows, so cannot be sure if there is not some other issue related to that, there are a number of shortcomings when you use rails on Windows, but that is mainly gem support, not JavaScript

Just as an interest, can you create a blank application, and do something like

rails g scaffold something field1 field2

And then check the code it generated in the views - I doubt it is different on Windows, but I cannot be sure

Also run the app and see if you can add/delete ok


Sent from my iPad

> On 28 Jan 2016, at 01:48, Bob Tian <lists@ruby-forum.com> wrote:
>
> 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 a topic in the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/Kf-1pDBEmK0/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

--
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/57C63773-DDFA-4789-81E4-61534FD97E32%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment