#3 new
Andrew Cox

How do you configure routes for the template plugin?

Reported by Andrew Cox | April 8th, 2009 @ 01:57 AM

I'm trying to use the 'template' plugin, but when I select a template from the dropdown, the route it generates looks something like this:

http://localhost:3000/spotlights...

How do I configure the tiny_mce plugin or my routes to make this go to my static template HTML file? Here is my current tiny_mce configuration (within my controller SpotlightsController):


uses_tiny_mce   :only => [:new, :create, :edit, :update],
                :options => {
                      :theme => 'advanced',
                      :mode => 'exact', 
                      :elements => 'spotlight_content', 
                      :theme_advanced_buttons1_add => "template",
                      :plugins => %w{ template }
                      },
                :raw_options => "template_templates : [ {
                      title : 'Editor Details',
                      src : 'editor_details.htm',
                      description : 'Adds Editors Name and Staff ID'
                      } ]"

Comments and changes to this ticket

  • Andrew Cox

    Andrew Cox April 9th, 2009 @ 08:36 AM

    I just looked at this again and figured out my (stupid) error. I was using a relative path for the 'src', so it was just tacking it on at the end. This works (assuming you have an editor_details.htm file in /public/javascripts/tiny_mce):

    
      uses_tiny_mce   :only => [:new, :create, :edit, :update],
      :options => {
        :theme => 'advanced',
        :mode => 'exact',
        :elements => 'spotlight_content',
        :theme_advanced_buttons1_add => "template",
        :plugins => %w{ template }
      },
      :raw_options => "template_templates : [ {
        title : 'Editor Details',
        src : '/javascripts/tiny_mce/editor_details.htm',
        description : 'Adds Editors Name and Staff ID'
      } ]"
    

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A Ruby on Rails plugin that allows easy implementation of the TinyMCE editor into your applications.

People watching this ticket

Pages