Created
March 28, 2010 15:27
-
-
Save meineerde/346807 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure to require this in your init.rb | |
class MyPluginIssueHook < Redmine::Hook::ViewListener | |
# this just renders the partial | |
# the contents of the context ahsh is made available as local variables to the partial | |
render_on :view_issues_form_details_bottom, :partial => 'hooks/view_issues_form_details_bottom' | |
def controller_account_success_authentication_after(context={ }) | |
# do something here | |
# This is an alternative approach. | |
# For view hooks, you can return a string which is inserted into the view | |
# (possible created by render_to_string) | |
# For controller hooks you can change objects in context (but not replace them) | |
# see http://github.com/edavis10/redmine-budget-plugin/blob/master/lib/budget_issue_hook.rb | |
# for a real life example | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment