What's the easiest way to replace the * .erb file?


(Evgeny) #1

Hello!

for example

discourse/app/views/list/list.erb

I created this file in the plugin: text/app/views/list/list.erb (And I copied the contents of the original file there)
In the file: plugin.rb

Need to specify a connection?

enabled_site_setting :text_enabled
load File.expand_path('../app/views/list/list.erb', __FILE__)

Unfortunately, I did not find how to do it.


(Muhlis C) #2

There is prepend_view_path method:
http://api.rubyonrails.org/classes/ActionView/ViewPaths/ClassMethods.html#method-i-prepend_view_path