Search code examples
ruby-on-railsrubyhelpertextile

Rails: installing & running Textile Editor Helper


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.


Solution

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

    Did you include the Prototype JS dependency?