I just want to use link_to
to open a popup. I tried something but it doesn't work:
<%= link_to 'Create a new company',
new_company_path,
:popup => ['create_company', 'height=600, width=600'] %> <br/>
Any idea?
Thanks!
Add this to your application.js.
$('a[data-popup]').on('click', function(e) { window.open($(this).attr('href')); e.preventDefault(); });
In the view, use something like:
= link_to( 'Create a new company', new_company_path, 'data-popup' => true )