Continuing to play around with it, apparently the javascript tags
aren''t
included in the scaffolding. When I include them all, the confirmation
dialog comes up, but still makes a GET request.
Maybe that just hasn''t been implemented yet. Hm.
On Thu, Jan 28, 2010 at 7:21 PM, Steve Klabnik
<steve.klabnik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:
> Has anyone been playing around with the Rails 3 code? I''m having
an issue
> with destroying models.
> I started an app using Yehuda''s "Spinning up a new Rails
app" example.
> Worked great. "script/generate scaffold Post title:string
body:text"
> Awesome. "rake db:migrate". Great. Everything works... except
destroying.
> The generated view shows this:
>
> <td><a href="/posts/3" data-confirm="Are you
sure?" data-method="delete"
>> data-url="/posts/3"
rel="nofollow">Destroy</a></td>
>
>
> Which looks correct, as far as I know. But when I hit it, no confirm
> dialog, and I get this in the server log:
>
> Started GET "/posts/3" for 67.163.143.192 at 2010-01-28 14:23:43
>
> Processing by PostsController#show as HTML
>
> Parameters: {"id"=>"3"}
>
> Post Load (0.2ms) SELECT "posts".* FROM "posts"
WHERE ("posts"."id" = 3)
>> LIMIT 1
>
> Rendered posts/show.html.erb within layouts/posts.html.erb (41.7ms)
>
> Completed in 51ms (Views: 43.3ms | ActiveRecord: 0.2ms) with 200
>
>
> So apparently it''s not understanding the data-method information.
>
> This leaves me with two questions. One, am I doing something wrong? And
> two, what''s the best resource for keeping up with things like
this, so that
> I don''t have to ask what could be a dumb question? I''m
already subscribed to
> rails-core, and several rails-related blogs... suggestions?
>
> Thanks,
> Steve
>
--
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.