ruby - Redmine Plugin Partials not being found -
i have been following redmine plugin tutorial , read page on hooks, still can't plugins partials render, using render_on
keyword or otherwise.
here's i'm putting partials:
app └── views ├── issues │ └── _issue_mail_settings_form.html.erb └── projects └── _mail_settings_form.html.erb
here class render_on
keyword, in lib
directory:
class mailsettingissuehooks < redmine::hook::viewlistener render_on :view_issues_form_details_bottom, :partial => "issues/issue_mail_settings_form" end
in init.rb require 'mail_setting_issue_hooks'
.
if load redmine this, can't view page issues - 404 error. console output request here, though doesn't useful.
if define method named view_issues_form_details_bottom
in mailsettingissuehooks
, returns string, renders correctly.
how render_on
keyword decide partials, , how can working?
when redmine loads plugins, adds default views directory of each - app/views
- global rails view path. catch not use actual directory on disk - assumes plugin located plugins/<name>
, <name>
argument use redmine::plugin.register
.
this means if init.rb
looks like:
redmine::plugin.register :cool_stuff ...
but plugin's directory redmine_cool_stuff
, code load , execute views not found.
solution: make sure argument plugin.register
same name of directory in redmine plugins
directory.
Comments
Post a Comment