Question

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.

Was it helpful?

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?

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top