Permalink
Browse files

Alternative AjaxCounter

  • Loading branch information...
1 parent b221131 commit 1bd7802bf22da148f91c8c936ea74ae659b4bcba @mneumann committed Jan 2, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 examples/ajax.rb
View
@@ -20,6 +20,7 @@ def state(s)
s.add_ivar(self, :@counter, @counter)
end
+=begin
def style
"div.wee-AjaxCounter a { border: 1px solid blue; padding: 5px; background-color: #ABABAB; };"
end
@@ -30,6 +31,11 @@ def render(r)
r.anchor.update_component_on(:click) { @counter += 1 }.with(@counter.to_s)
}
end
+=end
+
+ def render(r)
+ r.anchor.oid.update_component_on(:click) { @counter += 1 }.with(@counter.to_s)
+ end
end

0 comments on commit 1bd7802

Please sign in to comment.