Re: [Rails] Duplicate method in application_controller and application_helper

2011-05-11 Thread Walter Davis
Never mind, found helper_method. So now I have helper_method :current_practice in my ApplicationController, and it magically appears in the ApplicationHelper as well. Walter On May 11, 2011, at 2:34 PM, Walter Lee Davis wrote: I have a method: def current_practice if session[:imperson

[Rails] Duplicate method in application_controller and application_helper

2011-05-11 Thread Walter Lee Davis
I have a method: def current_practice if session[:impersonating] Practice.find session[:impersonating] else current_user.practice end end It is identical in both controller and helper. How could I DRY this up so I only need maintain it in one place? I already have