Forum: Ruby on Rails Initializers not available in controllers...

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.
Neal L (Guest)
on 2009-04-08 01:05
(Received via mailing list)
Hi all,

I have a file in config/initializers that specifies plan types.  The
file is:

======================
APP_PLANS = [
  {
    "id"         => 0,
    "name"       => 'free',
    "Price"      => 0,
    "Users"      => 1,
    "Storage"    => 0,
    "SSL"        => true
  }, {
    "id"         => 1,
    "name"       => 'basic',
    "Price"      => 24,
    "Users"      => 1,
    "Storage"    => 1,
    "SSL"        => true
  }
]
======================

In my account signup controller, I call:

  @plan_cost = APP_PLANS.[@plan_name]["Price"]

but I get an error:

  uninitialized constant ClientsController::APP_PLANS


So what am I doing wrong here? Why can't I get to the variable I
initialized???

Thanks!
Frederick C. (Guest)
on 2009-04-08 11:13
(Received via mailing list)
On Apr 7, 10:05 pm, Neal L <removed_email_address@domain.invalid> wrote:

>
Did you restart the server after adding/changing this initializer ?

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