Link to closed Rails 4 page
Using Rails 4 ..
I opened the page using javascript, for example:
<%= link_to "how to choose a rating", ratingsystem_path, :onclick=>"window.open(this.href,'create_company', 'height=600, width=600');return false;" %>
But when I add a link to close this page
<%= link_to "Close page", :onclick => "window.close();" %>
This does not work. Am I doing it wrong? Maybe use a tag instead?
+3
Kathan
source
to share
1 answer
Instead
<%= link_to "Close page", :onclick => "window.close();" %>
Try the following:
<%= link_to 'Close page', '_self', :onclick=>'window.close();' %>
You can replace '_self'
with a transfer not like''
This works for me, I hope the same;)
+6
Gagan gami
source
to share