Project

General

Profile

Wiki page in new tab

Added by Nick Bolton over 14 years ago

I am trying to create a new plugin which displays a specific wiki page in a new tab. So far I have extended the WikiController, but I can't see how to tell my plugin to use the wiki's existing views. How might I do this?

Perhaps I'm solving the problem the wrong way - if so please tell me.


Replies (2)

RE: Wiki page in new tab - Added by Felix Schäfer over 14 years ago

Have a look at the rails redner method, IIRC it allows you to specify the views you want rendered when calling the action you are executing.

RE: Wiki page in new tab - Added by Nick Bolton over 14 years ago

It seems that the render method was getting the view by joining @controller_path and @action_name to find the view in various paths. So in my case, it was looking for "foo/view.erb" where I needed it to be looking for "wiki/view.erb". One way of doing this is to just change @controller_path to "wiki" - though I can imagine this would have negative side effects if your controller were to do non-wiki stuff.

I am aware that this is doing a similar thing to the wiki extensions plugin, but I don't like the way it just redirects the tab to a wiki page -- it's quick and dirty, but kind of confusing for the user.

    (1-2/2)