Re: [jQuery] jQuery and Rails

2007-02-22 Thread Joshua Messer
Here's something similar for PHP I saw on Ajaxian. Apologies if this
has already been noted.

http://www.ngcoders.com/php/pquery-php-and-jquery/

I have not examined it, so I can't say whether it's worth looking at.

On 2/21/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 I've carefully read all of the responses to this thread (keep em coming),
 and believe that my solution will work very well for almost all of the
 concerns expressed here.

 I'll announce more details about the mechanism and syntax sometime in the
 next week or so, but I believe everyone will be very satisfied.

 -- Yehuda



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Klaus Hartl
Yehuda Katz schrieb:
 I'm in the process of building what will soon be the first release of 
 jQuery on Rails together with Steven Bristol, who was a winner of Rails 
 Hackfest (which won him a free ticket to RailsConf for his contributions 
 to the Rails core).

Great news again (does that stop these days?)!

 I had a few questions that I would love if you guys could answer:
 
 1) Are you using Rails?

Yes.

 3) Would you prefer an approach that generated JS by writing Ruby 
 helpers that generated jQuery code, or an approach that made is easier 
 to link up existing jQuery code into Rails?

I think both approaches are required. I'd use helpers if they generated 
unobtrusive code, but often I will have to step out of that and produce 
my own custom code.

 4) If you've used jQuery with Rails, what issues have you run into

No issues :-) It's just fun. By the way, jQuery feels much like Rails/Ruby.

 5) If you've used jQuery with Rails before, what type of application 
 (size, scope, etc.) was it?

We're using it for the Plazes rewrite. Scope: Location based social 
network, size: hopefully getting bigger each day ;-)


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Ⓙⓐⓚⓔ
though I'm not using ruby or ror, i did some reading and it looks very
interesting... will you have an install guide for jqor? I have ruby on
my mac, and have run simple programs but little more.

On 2/20/07, Yehuda Katz [EMAIL PROTECTED] wrote:
 I'm in the process of building what will soon be the first release of jQuery
 on Rails together with Steven Bristol, who was a winner of Rails Hackfest
 (which won him a free ticket to RailsConf for his contributions to the Rails
 core).

 I had a few questions that I would love if you guys could answer:

 1) Are you using Rails?
 2) If you're not, would you if it was easier to use jQuery with Rails?
 3) Would you prefer an approach that generated JS by writing Ruby helpers
 that generated jQuery code, or an approach that made is easier to link up
 existing jQuery code into Rails?
 4) If you've used jQuery with Rails, what issues have you run into
 5) If you've used jQuery with Rails before, what type of application (size,
 scope, etc.) was it?

 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




-- 
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Andreas Wahlin
 1) Are you using Rails?

Only in my spare time, but I want to use it more.

 3) Would you prefer an approach that generated JS by writing Ruby  
 helpers that generated jQuery code, or an approach that made is  
 easier to link up existing jQuery code into Rails?

I suppose the linkup ... not that used to rails or so yet, and since  
I'm mainly a client-side person, I don't really like the server-side  
to generate javascript ala rjs or similar.
I think I'd like some easy way to generate JSON and get that into  
Ajax stuff, and an easy way to know if a request was made by ajax and  
then filter/present partials/views accordingly. I'm really a beginner  
to rails so this may already exist in some form but stuff like

if request.ajax?
   render :partial = 'my_ajax_partial'
else
   render :partial ='normal_view'
end

or perhaps even some filter, in the view, than renders a partial with  
partialname_ajax or just partialname depending on the request.  
(following the rails magical convention over configuration)

or just give out json from a model in a controller

def json_request
   render: json = My_object.new(params).to_json
end

or something. again, this might exist, I don't know rails good at al  
and I'm just making some stuff up :)


 4) If you've used jQuery with Rails, what issues have you run into

haven't tried yet, but as things look now, I suppose I'll just use it  
as if it was with PHP or semething, that is, not really having any  
kind of server-side specific support like remote_form_tag or anything  
like that.


andreas



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Andre Lewis

Yehuda, I'm looking forward to jQuery on Rails!

1) Are you using Rails?


All my server-side work is in Rails.

3) Would you prefer an approach that generated JS by writing Ruby helpers

that generated jQuery code, or an approach that made is easier to link up
existing jQuery code into Rails?


I think the former (helpers generating jQ code) -- although I'm not sure
exactly what the latter would look like.
If you go the helpers route, they should avoid dumping JS inline in the HTML
(obviously, this is the beef with the standard Rails JS helpers). It would
be nice if the helpers could write all the JS into the header of your
document, or into an external JS file.

It looks like the UJS plugin has solved some of these problems already, so
it might serve as a useful point of reference. One of the other good things
they've done is provided an easy migration path to switch to UJS.


4) If you've used jQuery with Rails, what issues have you run into

You definitely pay a price in terms of development time. There has been a
lot of effort implementing Prototype/scriptaculous support in Rails --
including RJS templates --  and you throw that all away when you go the
jQuery route (my applications have been *all* jQ or *all*
proto/scriptaculous -- I've never mixed the two)


5) If you've used jQuery with Rails before, what type of application (size,

scope, etc.) was it?


Two Rails apps using exclusively jQ:
- hotspotr.com is a map-based app with ratings and reviews. Not huge, but
respectable.
- http://termmap.earthcode.com/build/web20 is smal, but with more JS. It's
basically one page, with a lot of JS interaction packed into it.

Thanks for your work on this,

Andre

--
Andre Lewis
Author, Google Maps Applications with Rails and Ajax
http://www.amazon.com/dp/1590597877/
My blog: http://earthcode.com
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Luke Lutman
Yehuda Katz wrote:
 1) Are you using Rails?
Yes :-)

 3) Would you prefer an approach that generated JS by writing Ruby 
 helpers that generated jQuery code, or an approach that made is easier 
 to link up existing jQuery code into Rails?
 4) If you've used jQuery with Rails, what issues have you run into
I'd prefer not to have helpers that generate js -- I can write javascript 
myself. I'd rather see 
the integration issues solved. One of the best things about rails is that it 
lets you bypass all 
the magic when you need to. Helpers (i.e. form_remote, etc.) can't handle every 
situation, so 
having accessible building blocks is crucial to me.

I realize there is a group of people who'd like to just write everything in 
Ruby (i.e. get to 
use javascript without having to know javascript), but I think that's a red 
herring. Plus, those 
concerns can be addressed by more complicated helpers, built on the more basic 
ones.

Here are the main issues I've run into:
+ unobtrusively including js specific to a view
+ targeting elements on a page without adding ID's all over the place
+ concatenation, compression and caching (i.e. cache the packed version of a 
bunch of scripts)

I think what I'd like (ideally) would be a basic helper (that wouldn't even 
need to be 
jQuery-specific) that I could call from any view which would concatenate, 
compress, and cache 
(fragment cache? page cache?) bits of javascript or javascript files, and add a 
script 
src=.../script tag to the head. If you have a plugin (or some custom 
code in an external 
file) that you only use in a few places, you could include it alongside inline 
script (if it was 
more widely used, it would go in your application-wide js file).

So, in whatever.rhtml, do something like:

 % javascript :file = 'path/to/plugin.js' %
 % javascript :text = %{ $('p').css('color','blue'); } %
 pWhatever.../p
 % javascript :text = %{ $('p').css('font-size', '2em'); }% %

And get:

 html
   head
 script type=text/javascript src=whatever.js/script
   /head
   body
 pWhatever.../p
   /body
 /html

In a way, what I'm picturing is very jQuery-centric -- there's a core utility, 
plus plugins 
(i.e. more complex, task-specific helpers).

Luke


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Klaus Hartl
Luke Lutman schrieb:
 Yehuda Katz wrote:
 1) Are you using Rails?
 Yes :-)
 
 3) Would you prefer an approach that generated JS by writing Ruby 
 helpers that generated jQuery code, or an approach that made is easier 
 to link up existing jQuery code into Rails?
 4) If you've used jQuery with Rails, what issues have you run into
 I'd prefer not to have helpers that generate js -- I can write javascript 
 myself. I'd rather see 
 the integration issues solved. One of the best things about rails is that it 
 lets you bypass all 
 the magic when you need to. Helpers (i.e. form_remote, etc.) can't handle 
 every situation, so 
 having accessible building blocks is crucial to me.
 
 I realize there is a group of people who'd like to just write everything in 
 Ruby (i.e. get to 
 use javascript without having to know javascript), but I think that's a red 
 herring. Plus, those 
 concerns can be addressed by more complicated helpers, built on the more 
 basic ones.
 
 Here are the main issues I've run into:
 + unobtrusively including js specific to a view
 + targeting elements on a page without adding ID's all over the place
 + concatenation, compression and caching (i.e. cache the packed version of a 
 bunch of scripts)
 
 I think what I'd like (ideally) would be a basic helper (that wouldn't even 
 need to be 
 jQuery-specific) that I could call from any view which would concatenate, 
 compress, and cache 
 (fragment cache? page cache?) bits of javascript or javascript files, and add 
 a script 
 src=.../script tag to the head. If you have a plugin (or some custom 
 code in an external 
 file) that you only use in a few places, you could include it alongside 
 inline script (if it was 
 more widely used, it would go in your application-wide js file).
 
 So, in whatever.rhtml, do something like:
 
  % javascript :file = 'path/to/plugin.js' %
  % javascript :text = %{ $('p').css('color','blue'); } %
  pWhatever.../p
  % javascript :text = %{ $('p').css('font-size', '2em'); }% %
 
 And get:
 
  html
head
  script type=text/javascript src=whatever.js/script
/head
body
  pWhatever.../p
/body
  /html
 
 In a way, what I'm picturing is very jQuery-centric -- there's a core 
 utility, plus plugins 
 (i.e. more complex, task-specific helpers).
 
 Luke

Luke, have you tried to use the AssetPackager plugin? It is not totally 
automatic as you have to define the scripts to be packed in one yml, but 
thats okay for me. I think merging whatever JavaScript there is into a 
file is not always good for files that are only included in special 
views, because that would result in a file that would not be loaded from 
cache because of the (minor) differences.



-- Klaus




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Klaus Hartl
Peter De Berdt schrieb:
 1) Are you using Rails?
 
 Yes, close to 24/7 :-)
 
 3) Would you prefer an approach that generated JS by writing Ruby helpers
 that generated jQuery code, or an approach that made is easier to link up
 existing jQuery code into Rails?
 
 A mix of both actually, it would be great if I could just replace
 Prototype/scriptaculous with jquery/interface and I wouldn't have to
 replace my Rails helpers with Javascript code (I prefer to use Rails
 helpers for the simple stuff and resort to custom JS code if the Rails
 helpers are not sufficient). The Rails helpers are really great for
 the day-to-day stuff, but they don't encompass the complete
 functionality of Proto/script.

This is *exactly* what I'm after - combined with the idea of UOJS, that is.


-- Klaus



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Chris Ovenden

On 2/21/07, Yehuda Katz [EMAIL PROTECTED] wrote:




1) Are you using Rails?



Yes, but still a newbie; migrating from PHP

3) Would you prefer an approach that generated JS by writing Ruby helpers

that generated jQuery code, or an approach that made is easier to link up
existing jQuery code into Rails?




I have avoided RoR's automatic javascript stuff, because I read that it's
not unobtrusive. But in any case I love to code in jQ (and I agree with
Klaus that there are similarities between jQ and Ruby) so have kept it
separate from the ruby stuff. I would be interested, though, in helper
methods in templates which hijax links automatically in an unobtrusive way
(including back button issues).

4) If you've used jQuery with Rails, what issues have you run into


We have several mini-sites running as separate Rails instances. We have a
module with common ruby code in it, but as yet we haven't found a nice way
to share javascript resources across projects.

Looking forward to seeing your first release!

--
Chris Ovenden

http://frontend.blogsome.com
Imagine all the people / Sharing all the world
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Luke Lutman
Klaus Hartl wrote:
   Luke, have you tried to use the AssetPackager plugin? It is not totally
 automatic as you have to define the scripts to be packed in one yml, but 
 thats okay for me. I think merging whatever JavaScript there is into a 
 file is not always good for files that are only included in special 
 views, because that would result in a file that would not be loaded from 
 cache because of the (minor) differences.
 
 -- Klaus

I hadn't seen AssetPackager before ... thanks for the tip! And I agree, the 
contatenation and 
caching would be tricky to get right.

Luke


-- 
zinc Roe Design
www.zincroe.com
(647) 477-6016

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Peter De Berdt
On 2/21/07, Klaus Hartl [EMAIL PROTECTED] wrote:
 Peter De Berdt schrieb:
  1) Are you using Rails?
 
  Yes, close to 24/7 :-)
 
  3) Would you prefer an approach that generated JS by writing Ruby helpers
  that generated jQuery code, or an approach that made is easier to link up
  existing jQuery code into Rails?
 
  A mix of both actually, it would be great if I could just replace
  Prototype/scriptaculous with jquery/interface and I wouldn't have to
  replace my Rails helpers with Javascript code (I prefer to use Rails
  helpers for the simple stuff and resort to custom JS code if the Rails
  helpers are not sufficient). The Rails helpers are really great for
  the day-to-day stuff, but they don't encompass the complete
  functionality of Proto/script.

 This is *exactly* what I'm after - combined with the idea of UOJS, that is.

Indeed, but considering jQuery users already being used to UOJS, I
didn't mention it, it seemed obvious to me :-)

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Peter De Berdt
 I realize there is a group of people who'd like to just write everything in 
 Ruby (i.e. get to
 use javascript without having to know javascript), but I think that's a red 
 herring.

That's not the main issue, but without MinusMOR, your RJS files would
always look like
page  some_jquery_code;
page  some_jquery_code;
I don't mind writing JavaScript myself either, but in order for jQuery
for Rails to be easily integrated into existing applications, the
helpers are a must. I have my fair share of applications that combine
both helpers and sporadically some custom JS code, but I don't want to
refactor all my RJS and view code just for being able to integrate
jQuery instead of proto/script. If it could be plug-and-play (and not
plug-and-pray) I wouldn't doubt and just deploy new versions of my
AJAXed apps just for jQuery.

 Here are the main issues I've run into:
 + unobtrusively including js specific to a view

... and a Rails way of keeping the behavior in a separate file
(separate behavior from representation). What I would do now, is
either use a partial to render the JS in the header and put it in my
layout or just add JS files to the public/javascripts directory, but I
don't find it very Rails-like, it doesn't feel like the best solution.

 So, in whatever.rhtml, do something like:

  % javascript :file = 'path/to/plugin.js' %
  % javascript :text = %{ $('p').css('color','blue'); } %
  pWhatever.../p
  % javascript :text = %{ $('p').css('font-size', '2em'); }% %

 And get:

  html
head
  script type=text/javascript src=whatever.js/script
/head
body
  pWhatever.../p
/body
  /html

Looks like Luke Redpath's UJS4Rails way of doing things :-) It's not a
bad solution, but UJS4Rails has introduced unreliable behavior in some
of the apps I have been working on.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-21 Thread Yehuda Katz

I've carefully read all of the responses to this thread (keep em coming),
and believe that my solution will work very well for almost all of the
concerns expressed here.

I'll announce more details about the mechanism and syntax sometime in the
next week or so, but I believe everyone will be very satisfied.

-- Yehuda

On 2/21/07, Peter De Berdt [EMAIL PROTECTED] wrote:


 I realize there is a group of people who'd like to just write everything
in Ruby (i.e. get to
 use javascript without having to know javascript), but I think that's a
red herring.

That's not the main issue, but without MinusMOR, your RJS files would
always look like
page  some_jquery_code;
page  some_jquery_code;
I don't mind writing JavaScript myself either, but in order for jQuery
for Rails to be easily integrated into existing applications, the
helpers are a must. I have my fair share of applications that combine
both helpers and sporadically some custom JS code, but I don't want to
refactor all my RJS and view code just for being able to integrate
jQuery instead of proto/script. If it could be plug-and-play (and not
plug-and-pray) I wouldn't doubt and just deploy new versions of my
AJAXed apps just for jQuery.

 Here are the main issues I've run into:
 + unobtrusively including js specific to a view

... and a Rails way of keeping the behavior in a separate file
(separate behavior from representation). What I would do now, is
either use a partial to render the JS in the header and put it in my
layout or just add JS files to the public/javascripts directory, but I
don't find it very Rails-like, it doesn't feel like the best solution.

 So, in whatever.rhtml, do something like:

  % javascript :file = 'path/to/plugin.js' %
  % javascript :text = %{ $('p').css('color','blue'); } %
  pWhatever.../p
  % javascript :text = %{ $('p').css('font-size', '2em'); }% %

 And get:

  html
head
  script type=text/javascript src=whatever.js/script
/head
body
  pWhatever.../p
/body
  /html

Looks like Luke Redpath's UJS4Rails way of doing things :-) It's not a
bad solution, but UJS4Rails has introduced unreliable behavior in some
of the apps I have been working on.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery and Rails

2007-02-20 Thread Yehuda Katz

I'm in the process of building what will soon be the first release of jQuery
on Rails together with Steven Bristol, who was a winner of Rails Hackfest
(which won him a free ticket to RailsConf for his contributions to the Rails
core).

I had a few questions that I would love if you guys could answer:

1) Are you using Rails?
2) If you're not, would you if it was easier to use jQuery with Rails?
3) Would you prefer an approach that generated JS by writing Ruby helpers
that generated jQuery code, or an approach that made is easier to link up
existing jQuery code into Rails?
4) If you've used jQuery with Rails, what issues have you run into
5) If you've used jQuery with Rails before, what type of application (size,
scope, etc.) was it?

--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2007-02-20 Thread Erik Beeson
Since you asked...

 1) Are you using Rails?

No.

 2) If you're not, would you if it was easier to use jQuery with Rails?

No.

--Erik

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery on Rails

2007-01-05 Thread Yehuda Katz

It's going to take a different approach than the built-in Rails one that
makes more of an effort to make use of the inherent power of JavaScript.

It's also going to make some thing easier (like sortable lists):

In the view, you'll do %= sortable_list :url = { ... }, ... %
In the controller, you'll do processes_sortable { options ... }
In the model, you'll do acts_as_sortable_list

And that's all folks.

-- Yehuda

On 1/5/07, Jon Baer [EMAIL PROTECTED] wrote:


Can I ask how the overall approach for this will be?  (ie, will it be a
rails plugin overriding all the helpers?) Or will there be additional
functionality?

Thanks.

- Jon

On Jan 5, 2007, at 5:14 PM, Francisco Brito wrote:

I'm looking forward to this. Seems like a very good opportunity for jQ
promotion especially since proto/culous enjoys the advantage of being
pre-packaged in rails.



On 1/5/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 I'm going to have something with jQuery 1.1 mid-January.

 -- Yehuda

 On 1/5/07, Jon Baer  [EMAIL PROTECTED]  wrote:
 
  Hi,
 
  Just coming back from holidays and playing catch up ...
 
  I know there was some discussion a while ago and it seems this was
  setup:
 
  http://trac.visualjquery.com/jQueryRails
 
  But is there an update on it?  (Also is there any similar approach to
  CakePHP 1.2?)  Ive read there were generic adapters but can't tell
  from the code/svn log.
 
  Thanks.
 
  - Jon
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 



 --
 Yehuda Katz
 Web Developer | Wycats Designs
 (ph)  718.877.1325
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/





--
Francisco Brito

http://nullisnull.blogspot.com | http://www.flickr.com/photos/darkgoyle |
http://brito.mindsay.com___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/






--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] JQuery on Rails

2007-01-04 Thread Jon Baer
Hi,

Just coming back from holidays and playing catch up ...

I know there was some discussion a while ago and it seems this was  
setup:

http://trac.visualjquery.com/jQueryRails

But is there an update on it?  (Also is there any similar approach to  
CakePHP 1.2?)  Ive read there were generic adapters but can't tell  
from the code/svn log.

Thanks.

- Jon

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] JQuery on Rails

2007-01-04 Thread Yehuda Katz

I'm going to have something with jQuery 1.1 mid-January.

-- Yehuda

On 1/5/07, Jon Baer [EMAIL PROTECTED] wrote:


Hi,

Just coming back from holidays and playing catch up ...

I know there was some discussion a while ago and it seems this was
setup:

http://trac.visualjquery.com/jQueryRails

But is there an update on it?  (Also is there any similar approach to
CakePHP 1.2?)  Ive read there were generic adapters but can't tell
from the code/svn log.

Thanks.

- Jon

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jQuery and Rails

2006-12-14 Thread Klaus Hartl
Hi all,

can someone share his experience of using jQuery with Rails? We are 
switching to Rails at Plazes but I'd like to stay in the jQuery camp :-)


Thanks,

Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Abdur-Rahman Advany
HI,

Currently I am using Rails and JQuery combined with Minus_r (a plugin by 
Dann Web).

But rails requires that you send the correct accept header to make 
respond_to work. So you need to adjust your ajax method (inside of 
jquery) with a few lines extra:

// Set Accept header based on dataType
if ( s.dataType == 'script' || s.dataType == 'json' )
  xml.setRequestHeader(Accept, text/javascript, text/html, 
application/xml, text/xml, */*);

if ( s.dataType == 'xml' )
  xml.setRequestHeader(Accept, application/xml, text/xml, text/html, 
text/javascript */*);

and when you are using one of the methods or plugins that allow you to 
set dataType just specify 'script' and rails wil respond_to :js(thus 
making RJS work with minus_r).

You will need minus_r as rails default way of handling .rjs is to 
evaluate it as ruby and not ERB.

Greets,

Abdul

Klaus Hartl wrote:
 Hi all,

 can someone share his experience of using jQuery with Rails? We are 
 switching to Rails at Plazes but I'd like to stay in the jQuery camp :-)


 Thanks,

 Klaus

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Yehuda Katz

I hate to say this again, but I'm working on a major Rails/jQuery project
that's shipping this week. When that's done, I'm going to extract out the
goodies from the project and make it jQuery on Rails. I know it's been a
while, but this project has taken precedence over my jQuery work for a month
or so. Hopefully I will have time for jQuery stuff starting next week.

-- Yehuda

On 12/14/06, Klaus Hartl [EMAIL PROTECTED] wrote:


Abdur-Rahman Advany schrieb:
 HI,

 Currently I am using Rails and JQuery combined with Minus_r (a plugin by
 Dann Web).

 But rails requires that you send the correct accept header to make
 respond_to work. So you need to adjust your ajax method (inside of
 jquery) with a few lines extra:

 // Set Accept header based on dataType
 if ( s.dataType == 'script' || s.dataType == 'json' )
   xml.setRequestHeader(Accept, text/javascript, text/html,
 application/xml, text/xml, */*);

 if ( s.dataType == 'xml' )
   xml.setRequestHeader(Accept, application/xml, text/xml, text/html,
 text/javascript */*);

 and when you are using one of the methods or plugins that allow you to
 set dataType just specify 'script' and rails wil respond_to :js(thus
 making RJS work with minus_r).

 You will need minus_r as rails default way of handling .rjs is to
 evaluate it as ruby and not ERB.

 Greets,

 Abdul

 Klaus Hartl wrote:
 Hi all,

 can someone share his experience of using jQuery with Rails? We are
 switching to Rails at Plazes but I'd like to stay in the jQuery camp
:-)


 Thanks,

 Klaus


Thanks Abdul for the information. I was thinking of using the Minus_r
plugin. Good to have some tips to start with!

Yehuda, what about jQuery on Rails?


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Klaus Hartl
Yehuda Katz schrieb:
 I hate to say this again, but I'm working on a major Rails/jQuery 
 project that's shipping this week. When that's done, I'm going to 
 extract out the goodies from the project and make it jQuery on Rails. I 
 know it's been a while, but this project has taken precedence over my 
 jQuery work for a month or so. Hopefully I will have time for jQuery 
 stuff starting next week.
 
 -- Yehuda

Yehuda, didn't meant to put additional pressure onto you :-) good luck!

We will start to create a few goodies as we need them in the meantime...


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jQuery and Rails

2006-12-14 Thread Yehuda Katz

Let me know. I strongly believe in extraction over abstraction. If you have
any specific questions as you start to use Rails, let me know.

-- Yehuda

On 12/14/06, Klaus Hartl [EMAIL PROTECTED] wrote:


Yehuda Katz schrieb:
 I hate to say this again, but I'm working on a major Rails/jQuery
 project that's shipping this week. When that's done, I'm going to
 extract out the goodies from the project and make it jQuery on Rails. I
 know it's been a while, but this project has taken precedence over my
 jQuery work for a month or so. Hopefully I will have time for jQuery
 stuff starting next week.

 -- Yehuda

Yehuda, didn't meant to put additional pressure onto you :-) good luck!

We will start to create a few goodies as we need them in the meantime...


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/