Ajax pop up box using Ruby on Rails

一曲冷凌霜 提交于 2019-11-30 15:41:24

You could do this with the jquery facebox. This kind of thing is better not done in rjs, but in unobtrusive javascript, that's where everyone is heading these days, it's much cleaner. You can attach the facebox rel to your links, then when clicked it can open the form in a popup window.

Then in your popup window you can do your form and redirect or whatever. The user will be only able to click one as when the pop up window opens an overlay is put over the page so clicking outside it either has no effect or closes the form (I think you choose in the config).

Sounds like the way to go.

jQuery UI also has a Dialog widget that works really well for this sort of thing. It's a nice widget and you can customize your jQuery UI library to include (or exclude if you want a slimmer javascript passed to the browser) other handy widgets as well (accordion, progressbar, etc)

Check out the Dialog examples at jQuery Dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!