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 jasonlewis.x-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Mobile 410.428.0253
AIM canweriotnow
Facebook http://www.facebook.com/canweriotnow
On Sat, Feb 5, 2011 at 12:26 PM, Mauro
<mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.