Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

undefined local variable or method `include_tiny_mce_if_needed'

#9

Hi, I'm have a project, where I have this line included in application.html.haml as described on http://github.com/kete/tiny_mce/tree/master step 3.

It all works fine in development, but in test and production it does not work. I get this error:

ActionView::TemplateError (undefined local variable or method `include_tiny_mce_if_needed' for #<ActionView::Base:0x7fbb18ea12a0>) on line \#8 of app/views/layouts/application.html.haml:

Any suggestions to, what to try.

Reported by Rene Madsen · August 18th, 2009 @ 11:36 PM

State: stale
Milestone: none
Assigned to: Kieran P Kieran P

Activity

  1. Kieran P
    Kieran P

    Hmm, I am unable to get the same issue you are describing. We've been using TinyMCE in development, production, and test without issue for some time.

    Can you start a new Rails app, and get the problem to occur with as little code as possible please. Then zip it and attach here. I'll try it on my end. If I'm lucky, it'll get the error (something I can debug). If I don't, them it might be something in your ruby environment.

    August 19th, 2009 @ 05:43 PM

  2. ronin-71764 (at lighthouseapp)
    ronin-71764 (at lighthouseapp)

    after doing exactly what is mentioned in the install howto, I get an error that is different but I think has to do with the same issue:

    undefined method `development?' for "development":String
    

    this happens when i add the line

    <%= include_tiny_mce_if_needed %>
    

    i figured out that it might have to do with <%= javascript_include_tag :all %> and I noticed that when I restart my server, a tinymce folder is created in public/javascripts, which is not loaded in my head tag when i drop the if_needed line in favor of include :all.

    Hope that helps,
    droom!

    October 2nd, 2009 @ 09:18 PM

  3. Kieran P
    Kieran P

    In the tiny_mce_helpers.rb file (or similarly named file depending on what version of the plugin/gem you've got installed), replace

    Rails.env.development?
    

    with

    Rails.env == 'development'
    

    I believe the error you're getting is because you're using a Rails version prior to 2.3?

    If the above change works for you, I'll make a commit to fix this in the next release.

    October 2nd, 2009 @ 10:16 PM

  4. ronin-71764 (at lighthouseapp)
    ronin-71764 (at lighthouseapp)

    thanks kieran - this works perfectly. and you are right - this was rails 2.1.0-4 (ubuntu), but with this modification, it works out nicely ;)

    October 3rd, 2009 @ 03:15 AM

  5. Kieran P
    Kieran P
    • State changed from open to resolved

    January 6th, 2010 @ 01:32 PM

  6. Kieran P
    Kieran P
    • State changed from resolved to open

    Hey jan.jones. As my first comment pointed out, I'm unable to reproduce this issue. Can you try the fix a few comments up. If that works, I'll push out a new tiny mce gem release with it soon.

    March 20th, 2010 @ 08:54 PM

  7. Kieran P
    Kieran P
    • State changed from open to stale

    There is a brand new release (0.1.2). Please post back if this release hasn't fixed the issue you were getting.

    March 25th, 2010 @ 10:08 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.