Forum: Ruby on Rails Help on error: dynamic constant assignment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
marciorf (Guest)
on 2005-12-06 04:57
(Received via mailing list)
Rails 0.14.3
Does anyone have an idea on this error:

compile error
./script/../config/../app/views//work_order_lines/_form.rhtml:-2:
dynamic constant assignment
QB_estimate_number = local_assigns[:QB_estimate_number] if
local_assigns.has_key?(:QB_estimate_number)


It was generated by this render:
<%= render (:partial => "work_order_lines/form",
                        :locals => {:wol => @work_order.id,
                                         :QB_estimate_number =>
@work_order.QB_estimate_number}) %>

Any help on this?


thx
ksruby (Guest)
on 2005-12-06 16:51
(Received via mailing list)
Local variables must start with lowercase. Otherwise Ruby interprets
them as a
constant.

Kent.
james (Guest)
on 2005-12-07 19:05
ksruby wrote:
> Local variables must start with lowercase. Otherwise Ruby interprets
> them as a
> constant.

So how do you create a local constant?

James
ksruby (Guest)
on 2005-12-07 19:12
(Received via mailing list)
In Ruby there is no such thing as a local constant.

Kent.
This topic is locked and can not be replied to.