Re: mako rails' text_field html escape problem
Thanks Mike. I hope rails refers to ruby on rails? If that is correct, why do we need to refer them 'rails' in Python Web Helpers? The concept could have been derived from rails but we can call them according to Webhelpers standard. We may include stylesheet_link as part of webhelpers.html.tags itself. On Feb 3, 2:05 am, Mike Orr sluggos...@gmail.com wrote: On Mon, Feb 2, 2009 at 10:05 AM, Krishgy kris...@gmail.com wrote: I made it working through webhelpers.html.tags. from webhelpers.html.tags import * I used h.text() instead of h.html_field. Thanks for online pylons book. Before I was refering chapters written long time ago. Are there any replacement for stylesheet_link_tag in webhelpers instead of using rails helper? h.stylesheet_link(url(/stylesheets/mystyle.css)) Note that stylesheet_link() outputs the exact URL specified. stylesheet_link_tag() added magic prefixes. If you need to use the deprecated rails helpers, you have to import them from webhelpers.rails.wrapped instead of webhelpers.rails. This wraps the output of each function in a literal, which prevents it from being escaped. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: mako rails' text_field html escape problem
On Tue, Feb 3, 2009 at 1:09 AM, Krishgy kris...@gmail.com wrote: Thanks Mike. I hope rails refers to ruby on rails? If that is correct, why do we need to refer them 'rails' in Python Web Helpers? The concept could have been derived from rails but we can call them according to Webhelpers standard. We may include stylesheet_link as part of webhelpers.html.tags itself. The rails helpers were ported from Ruby on Rails. I've never used Rails so I don't know how closely they match the originals, and of course they've been modified over time. The rails helpers are all in webhelpers.rails (though Pylons 0.9.7 applications should import them from webhelpers.rails.wrapped due to the escaping issue). But the rails helpers were all deprecated en masse in WebHelpers 0.6, and replaced by new helpers in webhelpers.html.tags, webhelpers.text, etc. Rails helpers are often named with suffixes like _tag, _to, etc. The new helpers generally do not have these suffixes: stylesheet_link_tag - stylesheet_link text_field - text radio_button - radio However, a few of the new helpers do keep the suffix: link_to - link_to -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
mako rails' text_field html escape problem
I use Pylons 0.9.7 on Debian 4.0 etch. Rails text_field returns escaped html output. Here is my helpers.py content helpers.py --- from webhelpers import * from webhelpers.html import * from webhelpers.html.tags import * from routes import url_for from webhelpers.rails import stylesheet_link_tag from webhelpers.rails import text_field my mako template ${h.text_field(name=display_name, id=display_name)} this renders the following in browser. input id=display_name name=display_name type=text / It seems like it is escaping the html content. ${h.text_field(name=display_name, id=display_name) | n} display right data. I mean, no filter. I think, rails helpers is depreciated. otherwise how to use text_field, stylesheet_link_tag features without rails helpers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: mako rails' text_field html escape problem
On Mon, Feb 2, 2009 at 10:05 AM, Krishgy kris...@gmail.com wrote: I made it working through webhelpers.html.tags. from webhelpers.html.tags import * I used h.text() instead of h.html_field. Thanks for online pylons book. Before I was refering chapters written long time ago. Are there any replacement for stylesheet_link_tag in webhelpers instead of using rails helper? h.stylesheet_link(url(/stylesheets/mystyle.css)) Note that stylesheet_link() outputs the exact URL specified. stylesheet_link_tag() added magic prefixes. If you need to use the deprecated rails helpers, you have to import them from webhelpers.rails.wrapped instead of webhelpers.rails. This wraps the output of each function in a literal, which prevents it from being escaped. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: mako rails' text_field html escape problem
I made it working through webhelpers.html.tags. from webhelpers.html.tags import * I used h.text() instead of h.html_field. Thanks for online pylons book. Before I was refering chapters written long time ago. Are there any replacement for stylesheet_link_tag in webhelpers instead of using rails helper? On Feb 2, 10:34 pm, Krishgy kris...@gmail.com wrote: I use Pylons 0.9.7 on Debian 4.0 etch. Rails text_field returns escaped html output. Here is my helpers.py content helpers.py --- from webhelpers import * from webhelpers.html import * from webhelpers.html.tags import * from routes import url_for from webhelpers.rails import stylesheet_link_tag from webhelpers.rails import text_field my mako template ${h.text_field(name=display_name, id=display_name)} this renders the following in browser. input id=display_name name=display_name type=text / It seems like it is escaping the html content. ${h.text_field(name=display_name, id=display_name) | n} display right data. I mean, no filter. I think, rails helpers is depreciated. otherwise how to use text_field, stylesheet_link_tag features without rails helpers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---