<p>How do I "name" a browser window in ROR, such that I can open a page in it later, from another (popup) window (using the target="name" html parameter)</p>

[{'answer_id': 36131, 'author': 'John Topley', 'author_id': 1450, 'author_profile': 'https://Stackoverflow.com/users/1450', 'pm_score': 4, 'selected': True, 'text': '<p>You have to use JavaScript for this:</p>\n\n<pre><code>&lt;script type="text/javascript"&gt;\n  window.name = "MyWindow";\n&lt;/script&gt;\n</code></pre>\n\n<p>Of course you could easily package this up into a Rails helper method. For example, in <code>app/helpers/application_helper.rb</code> add a new method:</p>\n\n<pre><code>def window_name(name)\n  content_for(:window_name) do\n    "&lt;script type=\\"text/javascript\\"&gt;window.name = \\"#{name}\\";&lt;/script&gt;"\n  end\nend\n</code></pre>\n\n<p>Next, in your layout file, add this line somewhere within the HTML <code>&lt;head&gt;</code> element:</p>\n\n<pre><code>&lt;%= yield :window_name %&gt;\n</code></pre>\n\n<p>Finally, in your view templates, simply add a line like this (can be anywhere you want) to output the correct JavaScript:</p>\n\n<pre><code>&lt;% window_name \'MyWindow\' %&gt;\n</code></pre>\n'}, {'answer_id': 30665419, 'author': 'John S.', 'author_id': 4975918, 'author_profile': 'https://Stackoverflow.com/users/4975918', 'pm_score': 0, 'selected': False, 'text': '<p>You could try below:</p>\n\n<pre><code>var x=window.open("", "myWindow");\nvar y="&lt;head&gt;&lt;title&gt;my window&lt;/title&gt;&lt;/head&gt;&lt;body&gt;my window&lt;/body&gt;";\nx.document.write(y);\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/36101', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3764/']