Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

How do you configure routes for the template plugin?

#3

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/7/editor_details.htm

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'
                      } ]"

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

State: resolved
Milestone: none
Assigned to: Kieran P Kieran P

Activity

  1. Andrew Cox
    Andrew Cox

    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'
      } ]"
    

    April 9th, 2009 @ 08:36 AM

  2. Kieran P
    Kieran P

    Hey Andrew. Glad you were able to work it out. And thanks for using the plugin.

    April 9th, 2009 @ 09:38 AM

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.