Skip to content

Instantly share code, notes, and snippets.

@coryschires
Created August 9, 2010 23:11
Show Gist options
  • Select an option

  • Save coryschires/516304 to your computer and use it in GitHub Desktop.

Select an option

Save coryschires/516304 to your computer and use it in GitHub Desktop.
var javascript_for = function(controller, action, anonymous_function) {
var correct_controller = APP.controller_name === controller,
correct_action = APP.action_name === action || 'all';
if (correct_controller && correct_action) {
anonymous_function();
};
};
javascript_for('events', 'index', function() {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment