<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LolocoJr &#187; render</title>
	<atom:link href="http://www.railsguru.com/articles/tag/render/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.railsguru.com</link>
	<description>Andy Lo-A-Foe&#039;s blog</description>
	<lastBuildDate>Thu, 21 Jul 2011 13:31:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>&quot;dynamic constant assignment&quot;, what?</title>
		<link>http://www.railsguru.com/articles/2005/11/02/dynamic-constant-assignment-what/</link>
		<comments>http://www.railsguru.com/articles/2005/11/02/dynamic-constant-assignment-what/#comments</comments>
		<pubDate>Wed, 02 Nov 2005 01:59:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[partials]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[render]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/06/13/dynamic-constant-assignment-what</guid>
		<description><![CDATA[So I upgraded my development environment to edge Rails. Testing on of the production apps turned up an interesting error: compile error .../app/views/domains/_MX_form.rhtml:-1: dynamic constant assignment MX_form = local_assigns[:MX_form] if local_assigns.has_key?(:MX_form) The Rails code: &#60;%= render :partial =&#62; &#34;#{@record_type.name}_form&#34; %&#62; &#8230; <a href="http://www.railsguru.com/articles/2005/11/02/dynamic-constant-assignment-what/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So I upgraded my development environment to edge Rails. Testing on of the production apps turned up an interesting error:<br/></p>
<pre>
compile error
.../app/views/domains/_MX_form.rhtml:-1: dynamic constant assignment
MX_form = local_assigns[:MX_form] if local_assigns.has_key?(:MX_form)
</pre>
<p>The Rails code:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">&lt;%= render <span class="sy">:partial</span> =&gt; <span class="s"><span class="dl">&quot;</span><span class="il"><span class="dl">#{</span><span class="iv">@record_type</span>.name<span class="dl">}</span></span><span class="k">_form</span><span class="dl">&quot;</span></span> <span class="s"><span class="dl">%&gt;</span></span></pre>
</td>
</tr>
</table>
<p>This code worked fine under Rails 0.13.1, huh? Turns out if the name attribute is <b>uppercase</b> Ruby will complain about a &#8220;dynamic constant assignment&#8221;. Okay, so  lowercasing all my partials and doing a downcase on name fixed it for me. But can anoyone explain why this happens all of a sudden? I&#8217;m still using the same Ruby interpreter version (1.8.2)???</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><script type="text/javascript"><!--
google_ad_client = "pub-6322765154114793";
/* 300x250, created 7/3/11 */
google_ad_slot = "6228709946";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2005/11/02/dynamic-constant-assignment-what/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

