Well, it depends on whether it's a link or form.

if a link, you would do:

$("#printed").click(function() {
 $.get($(this).attr("href"), null, null, "html");
 return false;
});

if a form,
("#printed").submit(function() {
 $.get($(this).attr("action"), null, $(this).serialize, "script");
 return false;
});


Jason Lewis

Email          [email protected]

Mobile         410.428.0253

AIM             canweriotnow
Facebook    http://www.facebook.com/canweriotnow


On Sat, Feb 5, 2011 at 12:26 PM, Mauro <[email protected]> wrote:

> There's a way to use rails routes into a jquery function puts inside
> the file application.js?
> I want to do something like this:
>
> $("#printed").click(function() {
>  $.get("customer_path(@customer)")
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to