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=>",'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?


source to share

1 answer


<%= 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;)



All Articles