passing in a method in the options-hash seems to work now, didn''t get
that to work earlier.
what i''m still confused about is how to use my resource-paths in this
line
= drop_receiving_element :delete_bin, :url =>
admin_tag_path(needs_an_id_here), :method => :delete, :hoverclass =>
''hover''
the admin_tag_path needs an id to be able to route to admin/
tags#destroy, is it even possible to use that (path)helper_method
here? (since i don''t have the id yet). adding a collection to the
resource that generates a route without an id to destroy a tag doesn''t
seem like the right way to go.
On Mar 23, 3:35 pm, Peter
<peterdun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> How should i write a nice restful route for an ajax-call that adds a
> tag to a particular game. I have games, they can have (multiple) tags,
> and you can edit those in the admin_area, for which i have written
> these resources:
>
> map.namespace(:admin) do |admin|
> admin.resources :games
> admin.resources :tags, :member => {:add_to_game => :post}
> end
>
> which gives me admin_games_path etc. By the way, is that (the admin/
> tags-controller) a good place for a method to add a tag to a game?
> Should it be elsewhere (in the admin/game-controller for example)?
>
> My problem is how i should write this in a drop_receiving_element tag,
> especially how i can pass a put-method with it, since that seems more
> logical in a restful-context. I had this in my routes (instead of
> above)
>
> map.namespace(:admin) do |admin|
> admin.resources :games
> admin.resources :tags, :member => {:add_to_game => :put}
> end
>
> but i didn''t know how to write that into my droppable-tag:
>
> drop_receiving_element div_id, :url =>
> add_to_game_admin_tag_path(someid), :hoverclass =>
''hover''
>
> that one only seems to generate (ajax) post-requests, and i didn''t
> succeed in passing a :method => :put with the url correcly.
>
> How should i write that?
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---