Getting "uninitialized constant" in Rails app

Posted by Robert McCabe on Stack Overflow See other posts from Stack Overflow or by Robert McCabe
Published on 2011-01-02T22:07:27Z Indexed on 2011/01/02 22:54 UTC
Read the original article Hit count: 248

Filed under:

I'm new to Rails and feeling my way, but this has me stumped. I moved some constants to a separate module ie:

module Fns
 Fclick = "function() { alert(\"You clicked the map.\");}\n"
 ...
end

then in my controller added:

require "fns"
class GeomapController < ApplicationController
  def index
      fstring = Fns::Fclick
  ...
  end

but when I run the server I get:

uninitialized constant Fns::Fclick

what am I missing?

© Stack Overflow or respective owner

Related posts about ruby-on-rails