Skip to content

Instantly share code, notes, and snippets.

@jasonmarkperez
Created March 12, 2010 22:34
Show Gist options
  • Save jasonmarkperez/330883 to your computer and use it in GitHub Desktop.
Save jasonmarkperez/330883 to your computer and use it in GitHub Desktop.
<% if current_account.subscription.plan?(:small) || current_account.subscription.plan?(:medium) -%>
<% content_for :script_onload do -%>
upsell("<%= @controller.controller_name%>")
<% end -%>
<some thing to display>
<% end -%>
$%#$^$%&#$%&#%^
var upsell = function(calling_page) {
$$(".upsell-observe").each(function(n){
n.observe('click', function(element){
switch(calling_page){
case "rule":
$('rule_owner_type_account').focus();
$('rule_owner_type_account').click();
return false;
break;
}
$('upsell-message').show();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment