开发者

How to use jquery load to open rails restful routes in a div

开发者 https://www.devze.com 2023-03-17 00:15 出处:网络
If I\'m abusing terminology, please excuse it. So I\'m using the google maps api, and jQuery, in a rails app. When a marker is clicked, I want content to load in a div.I can do this now.But I can\'t

If I'm abusing terminology, please excuse it.

So I'm using the google maps api, and jQuery, in a rails app. When a marker is clicked, I want content to load in a div. I can do this now. But I can't figure out how to load a restful route, like '/places/1/stories/3'.

this is what I have inside the function that listens for a user to click a map marker: ("story_view" is the div id where content is loaded)

$("#story_view").load('/places')
     return false;

This works perfectl开发者_如何学Goy, if all I wanted to do was load the places_path, but I need to be able to load content into the div based on parameters, like :id => @place.to_param, make sense?

How do I achieve this?

0

精彩评论

暂无评论...
验证码 换一张
取 消