`high_voltage` integration

plugins

(Hauleth) #1

I’m trying to add static pages integration to some Discourse apps. For now I’ve started writing plugin that will integrate high_voltage gem into that instances. For now this is simple script that just add that gem and setup routes for it:

# name: low_voltage
# about: Static pages for Discourse
# version: 0.1
# authors: Łukasz Niemier

gem 'high_voltage', '2.3.0'

after_initialize do
  Discourse::Application.routes.append do
    get '/pages/*id' => 'high_voltage/pages#show'
  end
end

I’ve also added app/views/pages/test.html file but whenever I want to display that page I get 404 error.

Am I doing something wrong or this is impossible?


Static pages plugin
(Manthan Mallikarjun) #2

To make it work try changing this like:

get '/pages/*id' => 'high_voltage/pages#show'

to

get '/pages/*id' => 'high_voltage/pages#show', id: 'test'

and rename test.html to test.html.erb. It should work.