Rails 3.1.x
2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other way to do these things
1 - drag_drop.js has...
$.post( "groups/add_member/", { "add": ui.draggable.text() } );
which is almost everything I want but I want to add @group.id to the URL. How can I get the value of @group.id into the jquery string?
2 - my controller has 'render :partial => 'memberships' and I have a utilities/_memberships.html.erb file but it doesn't 'refresh' after the change has been made. How do I ensure that the partial is refreshed? Obviously I can reload the whole page but that seems unnecessary.
1 down - 1 to go... can anyone toss me a bone here?
1 down - 1 to go... can anyone toss me a bone here?
Rails 3.1.x
2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other way to do these things
1 - drag_drop.js has...
$.post( "groups/add_member/", { "add": ui.draggable.text() } );
which is almost everything I want but I want to add @group.id to the URL. How can I get the value of @group.id into the jquery string?
----
can't figure out how to get @group.id from rails into the jquery string
These days I usually either stash things like that in the dom as data- attributes or stick a js snippet in the page that sets a global javascript variable to whatever the scripts that run on the page need to refer to
Fred
1 down - 1 to go... can anyone toss me a bone here?
Rails 3.1.x
2 questions... Perhaps I am doing this too much in the raw of jquery but I can't seem to find any other way to do these things
1 - drag_drop.js has...
$\.post\( "groups/add\_member/", \{ "add": ui\.draggable\.text\(\) \} \);
which is almost everything I want but I want to add @group.id to the URL. How can I get the value of @group.id into the jquery string?
----
can't figure out how to get @group.id from rails into the jquery string
I would put it on a 'data-*' attribute in the view, then get it with
jQuery and append it to the query string.