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.
6038bb9d72b1153299b5f06f693b49e0?d=identicon&s=25 marciorf (Guest)
on 2005-12-06 03: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
3ccecc71b9fb0a3d7f00a0bef6f0a63a?d=identicon&s=25 ksruby (Guest)
on 2005-12-06 15:51
(Received via mailing list)
Local variables must start with lowercase. Otherwise Ruby interprets
them as a
constant.

Kent.
Ff9e18f0699bf079f1fc91c8d4506438?d=identicon&s=25 james (Guest)
on 2005-12-07 18: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
3ccecc71b9fb0a3d7f00a0bef6f0a63a?d=identicon&s=25 ksruby (Guest)
on 2005-12-07 18: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.