Welcome Guest | Login

Undefined method 'markdown'

Folks,

Just deployed, however, I'm getting a error when the  'markdown' text helper is invoked. Its in Rails 1.1.4 and in any case I have this version frozen. I have also installed a local gem BlueCloth which it requires (and required it manually - which I didn't have to).  

Anyhow, getting undefined method 'markdown'... Its seems not to be finding it in text_helper.rb. Dev console gives the same error...

Any ideas...? My local dev and prod are fine with same version of Rails.

2006-08-09 09:07 AM

How are you using the method, exactly?  Post the relevant view code and we'll take a look.

And yes, you don't need to require Bluecloth if you have it unpacked in your vendor folder (assuming you've done this?)

2006-08-09 10:52 AM

Righto... here we are:

<%= markdown(item.description) %>
I have changed to:

<%= BlueCloth.new(item.description).to_html %>
and that works, so there is some joy, but really just curious why that particular helper's not working.

2006-08-09 12:03 PM

Hmmm, try pasting the markdown method in your application_helper.rb and see if it works?  Then at least we can isolate the problem...

2006-08-09 12:15 PM

Seems the following,
require_library_or_gem "bluecloth"
in text_helper.rb was failing to the rescue block and resulting in a load error. Comment it out and the markdown method is declared okay. Incidently, putting a copy in application_helper.rb didn't seem to make any difference. I haven't invested any time in it yet, but I wonder why
require_library_or_gem
was failing...?

2006-08-09 05:08 PM

Probably this...
$LOAD_PATH
in environment.rb if I had to guess.

2006-08-09 06:14 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!