Search code examples
ruby-on-railspopuplink-tolink-to-remote

(Rails) Using "link_to_remote" in conjunction with a popup/popout window...?


What is the most straightforward mechanism by which to "link_to_remote" and popout a window with the data? I need "link_to_remote" because I need to pass certain data along with the url without redoing my routes. If this would be better served by a "link_to" without the need to redo my routes, I'm all for it. I simply can't get it to work, atm.

Thoughts?


Solution

  • Perhaps you're looking for something like:

    <%= link_to_function "Show Article in Popout window",
          "window.open(#{article_path(article).to_json}, 'show_article')" %>