SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
Thread: What if...
-
Jun 5, 2006, 16:23 #1
What if...
...you could produce accessible, unobtrusive javascript, using Rails built-in javascript/prototype helpers, with just one extra line of code in your layout, a plugin, and one small enhancement to the helpers. Something like this:
PHP Code:<% form_remote_tag :controller => 'foo', :action => 'bar', :unobtrusive => true %>
# which produces
<form id="form_foo_bar" action="/foo/bar" method="post">
In addition, what if you could attach javascript functionality to your page elements in a Behaviour-like fashion, but using pure Ruby, anywhere in your view, but loaded from an external Javascript file?
Sorry to tease. Stay tuned, we have something very cool to show off in the next day or two.
-
Jun 5, 2006, 16:27 #2
tease
-
Jun 5, 2006, 16:33 #3
- Join Date
- Sep 2003
- Location
- KSA - UAE
- Posts
- 9,457
- Mentioned
- 8 Post(s)
- Tagged
- 1 Thread(s)
Originally Posted by vgarcia
-
Jun 5, 2006, 16:41 #4
OK, one more tease
PHP Code:# final api yet to be determined
register_javascript_behaviour("a#some_remote_link:click", "alert('Hello there!')")
# or pure ruby using built in rails helpers
register_javascript_behaviour("#content div.infobox_link:mouseover", visual_effect(:highlight, "infobox", :duration => 1)
# code generated in your html:
# yes, nothing!
Just trying out a bit of DHH style marketing
-
Jun 6, 2006, 00:29 #5
That looks interesting indeed, as I commented on your brand-new blog
-
Jun 6, 2006, 02:05 #6
You know what, I was being a bit dense last night - I've just moved hosts and my DNS hasn't been updated yet - I have my domain in my hosts file so I forgot. There is an actual post on my blog once the DNS has updated.
EDIT - you can go here for now http://66.29.86.208/ if its not working for you - I've tried my site through two networks and its updated on one and not the other.
Arto - I'm not seeing your comment on either blog (old or new host).
-
Jun 6, 2006, 02:25 #7
Hey Luke,
It says "Your comment is awaiting moderation.", here -- I checked, and that's on the new host.
-
Jun 6, 2006, 03:10 #8
Ah thanks for letting me know - I've turned moderation off for now.
-
Jun 6, 2006, 05:50 #9
- Join Date
- Jun 2003
- Location
- Iowa, USA
- Posts
- 3,749
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Luke Redpath
Jason Sweat ZCE - jsweat_php@yahoo.com
Book: PHP Patterns
Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
Detestable (adjective): software that isn't testable.
-
Jun 6, 2006, 08:41 #10
I'm gonna do a proper post about this later, with full instructions, but if you want to take a sneak peek in the meantime:
Subversion:
http://opensource.agileevolved.com/s...ive_javascript
Pretty Source Code Browsing:
http://opensource.agileevolved.com/t...ive_javascript
-
Jun 6, 2006, 10:47 #11
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That looks really cool! I hate to have to mix Javascript and HTML to use Rails' helpers.
-
Jun 6, 2006, 15:06 #12
Bookmarks