Editing page views with Irwi Wiki gem in Rails

293 Views Asked by At

What's the best way to edit and format page views using Irwi Wiki in Rails?

Here is the controller it's set up for me:

class WikiPagesController < ApplicationController
  acts_as_wiki_pages_controller
end

Though there's no views folder corresponding to the controller. I just want to be able to edit the html or add css to the wiki articles I can create now.

https://github.com/alno/irwi

2

There are 2 best solutions below

0
On BEST ANSWER

As it says in the docs:

You may create your own templates for controller actions (show, edit and history), in other case default built-in templates will be used.

So, in your views folder, create a folder called wiki_pages and then put your new templates in that folder.

Here's what's going on:

When your WikiPagesController currently goes to render a wiki page, it looks for a template in apps/views/wiki_page corresponding to the current action. That folder/file doesn't exist, so it looks in other directories and ultimately finds the template in the gem. (You should be able to see this process in your console.)

When you create the folder and add the template (as above), the WikiPagesController finds the template in your application and renders that, instead of rendering the template provided by the gem.

0
On

So I have done a little research and I think you can just copy all files from here: https://github.com/alno/irwi/tree/master/app/views/base_wiki_pages into views/wiki_pages folder so you will have all views locally and you will be able to edit them.