Hi all, <%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id => event.id, :present => ''1'') %> results in <a href="#" onclick="new Ajax.Request(''/attendees?present=1&event_id=61'', {asynchronous:true, evalScripts:true}); return false;">A</a>. For some reason amp; appears in the url. Someone knows why this happenes? Thanks in advance Stijn --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 22, 2007 8:59 AM, Tarscher <tarscher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id => > event.id, :present => ''1'') %> results in <a href="#" onclick="new > Ajax.Request(''/attendees?present=1&event_id=61'', > {asynchronous:true, evalScripts:true}); return false;">A</a>. For some > reason amp; appears in the url. > > Someone knows why this happenes?Missing route? -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
it''s not a rotring problem. The route is generated as it should be. It just injects amps; in the url. I actually guess this is a bug but someone must have seen this before, no? Stijn On 22 nov, 16:33, "Greg Donald" <gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 22, 2007 8:59 AM, Tarscher <tarsc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > <%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id => > > event.id, :present => ''1'') %> results in <a href="#" onclick="new > > Ajax.Request(''/attendees?present=1&event_id=61'', > > {asynchronous:true, evalScripts:true}); return false;">A</a>. For some > > reason amp; appears in the url. > > > Someone knows why this happenes? > > Missing route? > > -- > Greg Donaldhttp://destiney.com/--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 22, 2:59 pm, Tarscher <tarsc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id => > event.id, :present => ''1'') %> results in <a href="#" onclick="new > Ajax.Request(''/attendees?present=1&event_id=61'', > {asynchronous:true, evalScripts:true}); return false;">A</a>. For some > reason amp; appears in the url. > > Someone knows why this happenes?It''s not a bug. This is how you''re supposed to encode ampersands in HTML. Even in URLs which are part of tag attributes. Chris --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
strange things happen ;) i tried to reproduce it, but it was not possible. if it would be a bug, you would be right and this would have been seen by a lot of people before. the routes must exist, otherwise the path helper would have produced an error. but my guess would be the routing, too. maybe you are using nested routes and have some typing error there? could you post the routes? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The thing is that I don''t want to encode ampersands and have no idea where they come from. i only insert ids in the url andit seems that rails adds amp; to them. Stijn On 22 nov, 16:55, Chris Mear <ch...-OIzkuoyqg0kAvxtiuMwx3w@public.gmane.org> wrote:> On Nov 22, 2:59 pm, Tarscher <tarsc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > <%=link_to_remote "A", :url => attendee_path(:id => 1 , :event_id => > > event.id, :present => ''1'') %> results in <a href="#" onclick="new > > Ajax.Request(''/attendees?present=1&event_id=61'', > > {asynchronous:true, evalScripts:true}); return false;">A</a>. For some > > reason amp; appears in the url. > > > Someone knows why this happenes? > > It''s not a bug. This is how you''re supposed to encode ampersands in > HTML. Even in URLs which are part of tag attributes. > > Chris--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Well just send is as a query string..no need to use url tag..if u dont want to use amp just directly pass it as a query string and it will work -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tarscher wrote:> The thing is that I don''t want to encode ampersands and have no idea > where they come from. i only insert ids in the url andit seems that > rails adds amp; to them. > > StijnYou *have* to encode ampersands in order to be XHTML-compliant. Encoded ampersands in a query string in a URL are parsed just the same. If you''re working in, say, HTML 4 and you really don''t want the encoded ampersands, then do a search for the method that encodes them and override it. It''s a sensible default for Rails to do this. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Many thanks for all the replies. Still got some questions though When I examine (with a debugger) the ''present'' parameter that get send via the ''ampersanded'' url I see it calls them ''amp;present'' and not ''present'' as I want it to be called (and as defined in the model). Is there a way I can remove this amp; drom ''present''. About XHTML compliant: When I do a querry with Google http://www.google.com/search?q=test&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_nlBE238BE238 I dont'' see the amp; s in the url. Isn''t Google XHTML compliant or am I missing the point completeley Stijn On 22 nov, 17:29, Douglas Greenshields <rails-mailing-l...@andreas- s.net> wrote:> Tarscherwrote: > > The thing is that I don''t want to encode ampersands and have no idea > > where they come from. i only insert ids in the url andit seems that > > rails adds amp; to them. > > > Stijn > > You *have* to encode ampersands in order to be XHTML-compliant. Encoded > ampersands in a query string in a URL are parsed just the same. If > you''re working in, say, HTML 4 and you really don''t want the encoded > ampersands, then do a search for the method that encodes them and > override it. It''s a sensible default for Rails to do this. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Many thanks for all the replies. Still got some questions though When I examine (with a debugger) the ''present'' parameter that get send via the ''ampersanded'' url I see it calls them ''amp;present'' and not ''present'' as I want it to be called (and as defined in the model). Is there a way I can remove this amp; drom ''present''. About XHTML compliant: When I do a querry with Google http://www.google.com/search?q=test&sourceid=navclient-ff&ie=UTF-8&rl... I dont'' see the amp; s in the url. Isn''t Google XHTML compliant or am I missing the point completely Stijn On 22 nov, 17:29, Douglas Greenshields <rails-mailing-l...@andreas- s.net> wrote:> Tarscher wrote: > > The thing is that I don''t want to encode ampersands and have no idea > > where they come from. i only insert ids in the url andit seems that > > rails adds amp; to them. > > > Stijn > > You *have* to encode ampersands in order to be XHTML-compliant. Encoded > ampersands in a query string in a URL are parsed just the same. If > you''re working in, say, HTML 4 and you really don''t want the encoded > ampersands, then do a search for the method that encodes them and > override it. It''s a sensible default for Rails to do this. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 23, 2007 9:57 AM, Tarscher <tarscher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> About XHTML compliant: > When I do a querry with Google > http://www.google.com/search?q=test&sourceid=navclient-ff&ie=UTF-8&rl... > I dont'' see the amp; s in the url. Isn''t Google XHTML compliant or am > I missing the point completelyNo, google''s pages aren''t valid XHTML, or even valid HTML 4.01. Google doesn''t specify a doctype in their results pages, but when I tried validating a results page against HTML 4.01 I got around 240 errors. Ampersands are used in XHTML to indicate an entity that needs to be translated, so they can''t be used on their own. That applies just as much in entities (hrefs for links, image srcs, etc) as it does in text. They have to be escaped to be & There''s a lot of discussion of that online. Two I found quickly are: http://www.mezzoblue.com/archives/2003/02/17/urls_vs_xhtm/ http://annevankesteren.nl/2004/06/ampersands-matter James. -- James Stewart - Web Developer http://jystewart.net/process/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---