Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from anonymous/gist:303827
Created February 14, 2010 04:18
Show Gist options
  • Save radar/303831 to your computer and use it in GitHub Desktop.
Save radar/303831 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 = instance_variable_get('@'+@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