Submit Search
Upload
Merb jQuery
•
7 likes
•
1,067 views
Yehuda Katz
Follow
Using jQuery with Merb (and why Merb doesn't do RJS)
Read less
Read more
Technology
Business
Report
Share
Report
Share
1 of 56
Download now
Download to read offline
Recommended
jQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
Yehuda Katz
jQuery in 15 minutes
jQuery in 15 minutes
Simon Willison
jQuery PPT
jQuery PPT
Dominic Arrojado
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
jQuery Presentation
jQuery Presentation
Rod Johnson
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
jQuery basics
jQuery basics
Stijn Van Minnebruggen
jQuery for beginners
jQuery for beginners
Siva Arunachalam
Recommended
jQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
Yehuda Katz
jQuery in 15 minutes
jQuery in 15 minutes
Simon Willison
jQuery PPT
jQuery PPT
Dominic Arrojado
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
jQuery Presentation
jQuery Presentation
Rod Johnson
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
jQuery basics
jQuery basics
Stijn Van Minnebruggen
jQuery for beginners
jQuery for beginners
Siva Arunachalam
jQuery Essentials
jQuery Essentials
Bedis ElAchèche
22 j query1
22 j query1
Fajar Baskoro
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Brandon Dove
Devoxx 2014-webComponents
Devoxx 2014-webComponents
Cyril Balit
Introduction to jQuery
Introduction to jQuery
Gunjan Kumar
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
jQuery
jQuery
Mostafa Bayomi
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
phuphax
JQuery in Seaside
JQuery in Seaside
ESUG
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
borkweb
Prototype & jQuery
Prototype & jQuery
Remy Sharp
Introduction to JQuery
Introduction to JQuery
MobME Technical
Telling Stories With RSpec
Telling Stories With RSpec
rahoulb
SharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
Introduction to jQuery
Introduction to jQuery
Zeeshan Khan
Introduction to Prototype JS Framework
Introduction to Prototype JS Framework
Mohd Imran
Write Less Do More
Write Less Do More
Remy Sharp
Web Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
Merb Day Keynote
Merb Day Keynote
Yehuda Katz
Appnovation One Sheet
Appnovation One Sheet
Appnovation Technologies
More Related Content
What's hot
jQuery Essentials
jQuery Essentials
Bedis ElAchèche
22 j query1
22 j query1
Fajar Baskoro
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Brandon Dove
Devoxx 2014-webComponents
Devoxx 2014-webComponents
Cyril Balit
Introduction to jQuery
Introduction to jQuery
Gunjan Kumar
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
borkweb
jQuery
jQuery
Mostafa Bayomi
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
phuphax
JQuery in Seaside
JQuery in Seaside
ESUG
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
borkweb
Prototype & jQuery
Prototype & jQuery
Remy Sharp
Introduction to JQuery
Introduction to JQuery
MobME Technical
Telling Stories With RSpec
Telling Stories With RSpec
rahoulb
SharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
Introduction to jQuery
Introduction to jQuery
Zeeshan Khan
Introduction to Prototype JS Framework
Introduction to Prototype JS Framework
Mohd Imran
Write Less Do More
Write Less Do More
Remy Sharp
Web Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
What's hot
(20)
jQuery Essentials
jQuery Essentials
22 j query1
22 j query1
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Devoxx 2014-webComponents
Devoxx 2014-webComponents
Introduction to jQuery
Introduction to jQuery
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
jQuery
jQuery
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
JQuery in Seaside
JQuery in Seaside
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
Prototype & jQuery
Prototype & jQuery
Introduction to JQuery
Introduction to JQuery
Telling Stories With RSpec
Telling Stories With RSpec
SharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Introduction to jQuery
Introduction to jQuery
Introduction to Prototype JS Framework
Introduction to Prototype JS Framework
Write Less Do More
Write Less Do More
Web Projects: From Theory To Practice
Web Projects: From Theory To Practice
Viewers also liked
Merb Day Keynote
Merb Day Keynote
Yehuda Katz
Appnovation One Sheet
Appnovation One Sheet
Appnovation Technologies
Vaporware To Awesome
Vaporware To Awesome
Yehuda Katz
Testing Merb
Testing Merb
Yehuda Katz
Why You Shouldn't Write OO
Why You Shouldn't Write OO
Yehuda Katz
Making your oss project more like rails
Making your oss project more like rails
Yehuda Katz
Viewers also liked
(6)
Merb Day Keynote
Merb Day Keynote
Appnovation One Sheet
Appnovation One Sheet
Vaporware To Awesome
Vaporware To Awesome
Testing Merb
Testing Merb
Why You Shouldn't Write OO
Why You Shouldn't Write OO
Making your oss project more like rails
Making your oss project more like rails
Similar to Merb jQuery
Building Web Interface On Rails
Building Web Interface On Rails
Wen-Tien Chang
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
railsconf
JavaScript on Rails 튜토리얼
JavaScript on Rails 튜토리얼
Sukjoon Kim
Page Caching Resurrected
Page Caching Resurrected
Ben Scofield
Developing and testing ajax components
Developing and testing ajax components
Ignacio Coloma
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
Carles Farré
Html and i_phone_mobile-2
Html and i_phone_mobile-2
tonvanbart
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJs
Wildan Maulana
Front End on Rails
Front End on Rails
Justin Halsall
Plone Interactivity
Plone Interactivity
Eric Steele
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
Rob
jQuery for Sharepoint Dev
jQuery for Sharepoint Dev
Zeddy Iskandar
What's new in Rails 2?
What's new in Rails 2?
brynary
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
Igor Sobreira
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
John Brunswick
Jsf Ajax
Jsf Ajax
rajivmordani
Struts2
Struts2
yuvalb
Opensocial Codelab
Opensocial Codelab
Pieter De Schepper
Javascript Basic
Javascript Basic
Kang-min Liu
Ajax On S2 Odp
Ajax On S2 Odp
ghessler
Similar to Merb jQuery
(20)
Building Web Interface On Rails
Building Web Interface On Rails
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
JavaScript on Rails 튜토리얼
JavaScript on Rails 튜토리얼
Page Caching Resurrected
Page Caching Resurrected
Developing and testing ajax components
Developing and testing ajax components
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
Html and i_phone_mobile-2
Html and i_phone_mobile-2
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJs
Front End on Rails
Front End on Rails
Plone Interactivity
Plone Interactivity
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
jQuery for Sharepoint Dev
jQuery for Sharepoint Dev
What's new in Rails 2?
What's new in Rails 2?
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
Jsf Ajax
Jsf Ajax
Struts2
Struts2
Opensocial Codelab
Opensocial Codelab
Javascript Basic
Javascript Basic
Ajax On S2 Odp
Ajax On S2 Odp
More from Yehuda Katz
Sprout core and performance
Sprout core and performance
Yehuda Katz
Writing Fast Client-Side Code: Lessons Learned from SproutCore
Writing Fast Client-Side Code: Lessons Learned from SproutCore
Yehuda Katz
SproutCore: Amber
SproutCore: Amber
Yehuda Katz
Rails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
Yehuda Katz
Organizing jQuery Projects Without OO
Organizing jQuery Projects Without OO
Yehuda Katz
Rails 3 overview
Rails 3 overview
Yehuda Katz
Merb Camp Keynote
Merb Camp Keynote
Yehuda Katz
Merb
Merb
Yehuda Katz
DataMapper
DataMapper
Yehuda Katz
jQuery and Ruby Web Frameworks
jQuery and Ruby Web Frameworks
Yehuda Katz
More from Yehuda Katz
(10)
Sprout core and performance
Sprout core and performance
Writing Fast Client-Side Code: Lessons Learned from SproutCore
Writing Fast Client-Side Code: Lessons Learned from SproutCore
SproutCore: Amber
SproutCore: Amber
Rails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
Organizing jQuery Projects Without OO
Organizing jQuery Projects Without OO
Rails 3 overview
Rails 3 overview
Merb Camp Keynote
Merb Camp Keynote
Merb
Merb
DataMapper
DataMapper
jQuery and Ruby Web Frameworks
jQuery and Ruby Web Frameworks
Recently uploaded
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Scott Keck-Warren
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
AndikSusilo4
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Deakin University
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
BookNet Canada
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
XfilesPro
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
null - The Open Security Community
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
LBM Solutions
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
HostedbyConfluent
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
OnBoard
Recently uploaded
(20)
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
Merb jQuery
1.
Merb with jQuery (not
RJS)
2.
Rails and JS
3.
<% remote_form_for(@user) do
|f| %> <%= f.text_field :username %> <% end %>
4.
<form action=quot;/usersquot; class=quot;new_userquot; id=quot;new_userquot;
method=quot;postquot; onsubmit=quot;new Ajax.Request('/users', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;quot;><div style=quot;margin:0;padding: 0quot;><input name=quot;authenticity_tokenquot; type=quot;hiddenquot; inline JS value=quot;dcab4e1ab6a78f1f618b97008246df33340 75ca9quot; /></div> <input id=quot;user_usernamequot; name=quot;user[username]quot; size=quot;30quot; type=quot;textquot; /> </form>
5.
<center> <font
face=quot;Arialquot;>Hello</font> </center>
6.
<center> <font
face=quot;Arialquot;>Hello</font> </center> we stopped doing this
7.
“It works”
8.
Kinda.
9.
Difficulty
Time in Project
10.
Difficulty remote_form_for...
fantastic! so easy! Time in Project
11.
Difficulty autocomplete!
wow! I don’t need any JS! Time in Project
12.
holy cow... RJS... Difficulty
Who needs this stodgy “Javascript” Time in Project
13.
Difficulty
one day... Time in Project
14.
we need an Difficulty
autocompleter that talks to a web service Time in Project
15.
Difficulty
quick... cancel the launch Time in Project
16.
Difficulty
Time in Project
17.
Or...
18.
Difficulty
Time in Project
19.
learn JS or
hire someone who Difficulty knows JS Time in Project
20.
“It’s hard”
21.
Let’s take a
look
22.
<%= form_for(@user, :class
=> quot;remotequot;, :action => quot;/fooquot;) do %> <%= text_field :username %> <% end =%>
23.
<form class=quot;remotequot; method=quot;postquot;
action=quot;/fooquot;> <input type=quot;textquot; class=quot;textquot; value=quot;quot; name=quot;usernamequot; id=quot;params_usernamequot;/> </form>
24.
And the JavaScript
25.
(scary!)
26.
$(quot;form.remotequot;).ajaxForm();
27.
link_to_remote
28.
<%= link_to_remote quot;Awesome!quot;,
:url => quot;/fooquot;, :update => quot;some_idquot; %>
29.
<a href=quot;#quot; onclick=quot;new Ajax.Updater('some_id',
'/foo', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('dcab4e1ab6a78f1f618b97 008246df3334075ca9')}); return false;quot;>Awesome!</a> JS! inline
30.
<a href=quot;#quot; onclick=quot;new Ajax.Updater('some_id',
'/foo', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('dcab4e1ab6a78f1f618b97 008246df3334075ca9')}); return (so easy!) false;quot;>Awesome!</a>
31.
<%= link_to quot;Awesome!quot;,
quot;/fooquot;, :rel => quot;#some_idquot;, :class => quot;remotequot; %>
32.
<a href=quot;/fooquot; class=quot;remotequot;
rel=quot;#some_idquot;>Awesome!</a>
33.
“I bet the
JavaScript is super-crazy”
34.
$(quot;a.remotequot;).click(function() {
if(this.rel) $(this.rel).load(this.href); else $.get(this.href); return false; })
35.
CSS selector $(quot;a.remotequot;).click(function() {
if(this.rel) $(this.rel).load(this.href); else $.get(this.href); return false; })
36.
$(quot;a.remotequot;).click(function() {
if(this.rel) $(this.rel).load(this.href); else $.get(this.href); return false; }) supplying a rel means update
37.
$(quot;a.remotequot;).click(function() {
if(this.rel) $(this.rel).load(this.href); else $.get(this.href); return false; }) otherwise use $.get
38.
X $(quot;a.remotequot;).click(function() { })
if(this.rel) $(this.rel).load(this.href); else $.get(this.href); return false; no JS?
39.
<a href=quot;/fooquot; class=quot;remotequot;
rel=quot;#some_idquot;>Awesome!</a>
40.
Want a helper?
41.
def link_to_remote(text, url,
options = {}) if options.key?(:update) options[:rel] = options.delete(:update) end options[:class] = options[:class].to_s. split(quot; quot;).push(quot;remotequot;).join(quot; quot;) link_to(text, url, options) end
42.
If you switch
to Prototype (o.O)
43.
$$(quot;a.remotequot;).observe(quot;clickquot;, function() {
if(this.rel) new Ajax.Updater($$(this.rel), this.href); else new Ajax.Request(this.href); return false; });
44.
Using JSON
45.
class Speakers <
Application provides :json def index @speakers = Speaker.all display @speakers end end
46.
class Speakers <
Application provides :json def index @speakers = Speaker.all display @speakers end end
47.
$.getJSON(quot;/speakersquot;, function(json) {
// [{id: 1, name: quot;Joe Blowquot;}] });
48.
$.getJSON(quot;/speakersquot;, function(json) {
// [{id: 1, name: quot;Joe Blowquot;}] }); Accept: application/json
49.
class Speakers <
Application provides :json def index @speakers = Speaker.all display @speakers end end @speakers.to_json
50.
What about RJS?
51.
page.insert_html :bottom, 'list',
content_tag(quot;liquot;, quot;Foxquot;)
52.
Generated JS
53.
try {
new Insertion.Bottom(quot;listquot;, quot;<li>Fox</ li>quot;); } catch (e) { alert('RJS error:nn' + e.toString()); alert('new Insertion.Bottom(quot;listquot;, quot;<li>Fox</li>quot;);'); throw e }
54.
Big Scary JS
55.
$.get(quot;/ajax_urlquot;, function(html) {
$(quot;#listquot;).append(html) })
56.
Thank you.
Download now