Skip to content

Instantly share code, notes, and snippets.

Created February 14, 2010 04:14
Show Gist options
  • Save anonymous/303827 to your computer and use it in GitHub Desktop.
Save anonymous/303827 to your computer and use it in GitHub Desktop.
after_filter :setup_generic_variables
def setup_generic_variables()
@controller_name = self.controller_name
@model_name = controller_name.singularize
@instance = send('@'+@model_name)
@edit_path_method = 'edit_' + @model_name + '_path'
@index_path_method = @model_name + '_path'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment