Question

I have created plugin for redmine that displays issues with some additional info. Plugin works ok. Now i want this information to be shown on project page under issues summary. ive read this article http://www.redmine.org/boards/3/topics/33949

and rednder_on approach looks very promising. ive added new plugin with hook for view_projects_show_right code looks like this

# lib/release_history_hook.rb

class ReleaseHistoryHook < Redmine::Hook::ViewListener
render_on :view_projects_show_right, :partial => 'bottlenecks/view_issues'
end

bottlenecks plugin tree structure is like this

/opt/redmine/plugins/bottlenecks/
├── app
│   ├── controllers
│   │   ├── bottlenecks_controller.rb
│   │   └── bottlenecks_controller.rb~
│   ├── helpers
│   │   ├── bottlenecks_helper.rb
│   │   └── bottlenecks_helper.rb~
│   ├── models
│   └── views
│   └── bottlenecks
│   ├── view_issues.html.erb
│   ├── view_issues.html.erb~
│   ├── view_issues.html_original.erb
│   ├── view_issues.html_original.erb~
│   └── view_users.html.erb
├── assets
│   ├── images
│   ├── javascripts
│   └── stylesheets
├── config
│   ├── locales
│   │   └── en.yml
│   └── routes.rb
├── db
│   └── migrate
├── init.rb
├── init.rb~
├── lib
│   └── tasks
├── README.rdoc
└── test
├── fixtures
├── functional
│   └── bottlenecks_controller_test.rb
├── integration
├── test_helper.rb
└── unit

21 directories, 16 files

Ive tried to specify full path,path with extensions ...all the combinations. When i run redmine and access project page its always gives me 404 error. I clearly misunderstand something very basic. I just cant find more information on that subject. What am i doing wrong? Also render_on seems to be deprecated. What can i use instead?

Was it helpful?

Solution

it seems to me that you named your partial incorectly without prefix "_". You should place file _view_issues.html.erb to YOUR_PLUGIN/app/views/bottlenecks/

Source to read more http://www.redmine.org/projects/redmine/wiki/Hooks

Examples:

how to call hook https://github.com/edavis10/redmine_contracts/blob/master/lib/redmine_contracts/hooks/view_issues_show_details_bottom_hook.rb

code of the hook https://github.com/edavis10/redmine_contracts/blob/master/app/views/issues/_show_deliverable.html.erb

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top