Skip to content

Instantly share code, notes, and snippets.

@meineerde
Created March 28, 2010 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meineerde/346807 to your computer and use it in GitHub Desktop.
Save meineerde/346807 to your computer and use it in GitHub Desktop.
# 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