I just typed a long post with my model, controller and view file snippets, and lost it :( Here goes again: I have a 2 postgres tables: files and lines. Files simply has an id and a string name. Lines has a file_id, line_number and line_text. I have the associations set up nicely so: @lines = File.find(params[:id]).lines works nicely. The only problem is that if a line has a ''<'' in it, anything after the ''<'' is getting eaten (ie not showing up). Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom wrote:> Eaten up where? How are you verifying this? What happens if you run the > above in script/console? Any chance it''s getting eaten because < is being > considered an html tag so swallowing the rest of the text perhaps because > there isn''t a closing > ? If so, look into escaping/encoding it before > you display it. > > Maybe...That''s exactly what is happening (I figured it out right after I posted). I looked in the page source and all my text was there. the browser sees the ''<'' and tried to resolve a tag out of it. when it can''t all the text between it and the next valid closing tag is eaten. I guess I''ll have to replace any ''<'' with ''<'' in my controller before passing it to the view Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom wrote:> Eaten up where? How are you verifying this? What happens if you run the > above in script/console? Any chance it''s getting eaten because < is being > considered an html tag so swallowing the rest of the text perhaps because > there isn''t a closing > ? If so, look into escaping/encoding it before > you display it. > > Maybe...That''s exactly what is happening (I figured it out right after I posted). I looked in the page source and all my text was there. the browser sees the ''<'' and tried to resolve a tag out of it. when it can''t all the text between it and the next valid closing tag is eaten. I guess I''ll have to replace any ''<'' with ''<'' in my controller before passing it to the view Thanks --~--~---------~--~----~------------~-------~--~----~ 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 3 Oct 2007, at 17:08, Reacher wrote:> > > Philip Hallstrom wrote: >> Eaten up where? How are you verifying this? What happens if you >> run the >> above in script/console? Any chance it''s getting eaten because < >> is being >> considered an html tag so swallowing the rest of the text perhaps >> because >> there isn''t a closing > ? If so, look into escaping/encoding it >> before >> you display it. >> >> Maybe... > That''s exactly what is happening (I figured it out right after I > posted). I looked in the page source and all my text was there. the > browser sees the ''<'' and tried to resolve a tag out of it. when it > can''t all the text between it and the next valid closing tag is > eaten. I guess I''ll have to replace any ''<'' with ''<'' in my > controller before passing it to the view >The h function will do that. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
http://www.gazeteport.com.tr/YAZARARANIYOR/NEWS/GP_083040 On 3 Ekim, 18:46, Reacher <brandon.g.jo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I just typed a long post with my model, controller and view file > snippets, and lost it :( Here goes again: > > I have a 2 postgres tables: files and lines. Files simply has an id > and a string name. Lines has a file_id, line_number and line_text. I > have the associations set up nicely so: > > @lines = File.find(params[:id]).lines > > works nicely. The only problem is that if a line has a ''<'' in it, > anything after the ''<'' is getting eaten (ie not showing up). > > Any ideas?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I just typed a long post with my model, controller and view file > snippets, and lost it :( Here goes again: > > I have a 2 postgres tables: files and lines. Files simply has an id > and a string name. Lines has a file_id, line_number and line_text. I > have the associations set up nicely so: > > @lines = File.find(params[:id]).lines > > works nicely. The only problem is that if a line has a ''<'' in it, > anything after the ''<'' is getting eaten (ie not showing up).Eaten up where? How are you verifying this? What happens if you run the above in script/console? Any chance it''s getting eaten because < is being considered an html tag so swallowing the rest of the text perhaps because there isn''t a closing > ? If so, look into escaping/encoding it before you display it. Maybe... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Philip Hallstrom wrote: >> Eaten up where? How are you verifying this? What happens if you run the >> above in script/console? Any chance it''s getting eaten because < is being >> considered an html tag so swallowing the rest of the text perhaps because >> there isn''t a closing > ? If so, look into escaping/encoding it before >> you display it. >> >> Maybe... > That''s exactly what is happening (I figured it out right after I > posted). I looked in the page source and all my text was there. the > browser sees the ''<'' and tried to resolve a tag out of it. when it > can''t all the text between it and the next valid closing tag is > eaten. I guess I''ll have to replace any ''<'' with ''<'' in my > controller before passing it to the view# Escape special characters in HTML, namely &\"<> CGI::escapeHTML(''Usage: foo "bar" <baz>'') # => "Usage: foo "bar" <baz>" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---