0

I've done my rails page help documentation with the HelpNDoc help authoring tool. It generated a folder with some HTML pages and 4 more folders (js, img, css and lib). I'm looking for the best way for adding this functionality to my rails app.

So far I've tried to create a new controller called "help" and add the files to the view folder. After that I changed the application.js and application.css.scss files to add the js and css files. Turns out that the HTML files contain scripts, so I've placed them in the help.js file. This looks like the hardest solution since I have to look into the files to change references and other stuff.

Is there any other solution which doesn't involve changing a lot of things ?

Any help is appreciated.

My solution

I used an Engine (http://guides.rubyonrails.org/engines.html). I have to edit the html files to fix the routes but this is the cleanest solution.

jonjbar
  • 3,896
  • 1
  • 25
  • 46
user2782149
  • 39
  • 2
  • 9

2 Answers2

0

HelpNDoc and other help authoring tools will generate static HTML content including: HTML, Javascript, CSS and possibly media elements. The best solution would be to host your documentation apart from your Rails app, on a static server or sub-domain such as help.yourapp.com

The following tutorial might help you setup a sub-domain with static content alongside your Rails app: http://www.yearofmoo.com/2011/09/serve-precompiled-rails-assets-from-a-static-domain.html

jonjbar
  • 3,896
  • 1
  • 25
  • 46
  • I'm gonna read this tutorial, try it and I'll tell you if this applies to my situation. I'll be back in an hour...thanks – user2782149 Jan 14 '16 at 13:20
  • I've been researching a lot and I have to thank you because you led me through the right direction. I ended up using the engine solution (it's not a subdomain, it's more like using a gem). – user2782149 Jan 14 '16 at 22:56
0

I'd suggest pasting the HTML as a view and then linking it through routes and the app

  • What would you recomend with the other folders? They have some javascript, css and the images...I've tried to create a controller with those views, include those folders (located in the assets folder) in my application.js and application.css.scss, but it looks like I have to modify a lot of things to make the html work with what I've done with rails. – user2782149 Jan 14 '16 at 13:17