views:

503

answers:

2

I'm trying to get a Textile Editor Helper on my Rails site. I installed the latest version from git, installed it and now trying to get things running. I put the code:

<p>
   <%= f.label :message %><br />
   <%= f.textile_editor :message -%>
</p>

but Rails return an error, pointing I don't have a proper method:

undefined method `textile_editor' for #<ActionView::Helpers::FormBuilder:0x[...]>

I've only installed this version of TEH because it understands f.textile_editor construction but it seems not working. Well, OK. But while trying the original way, writing (2 args):

<p>
   <%= f.label :message %><br />
   <%= textile_editor @post, :message -%>
</p>

I receive a clear clone of a simple text_area without any formatting buttons at the top. I'm carefully follow the instructions at the SlateBlog article, inserting at the very end of my form the following line:

<%= textile_editor_initialize -%>

Am I missing something? OK, if the TEH is still buggy (which I doubt) what are the alternatives? Feel free to give advices (as I'm still a Rails beginner). The criteria is maximum simplicity of installation and usage.

+2  A: 

It might seem silly, but did you restart or reload your project so the plugin is loaded?

Did you include the Prototype JS dependency?

Garrett
That helped! Thank you ;)Gosh, I've spent over a couple of hours today figuring out the roots of the problem...
gmile
No problem, I have had my fair share of forgetting to restart or forgetting Prototype and I still don't learn, hah!
Garrett
A: 

Following the readme worked for me. Double check to make sure you ran the rake task - it won't hurt to run it again. Make sure that you have <%= javascript_include_tag :all %> in your layout. If you're using jQuery there are instructions specific to jQuery in the readme.

Andy Gaskell