Hi -- On Wed, Jul 20, 2011 at 11:51 AM, Jens Wille <jens.wi...@uni-koeln.de>wrote:
> hi david! > > David A. Black [2011-07-20 15:24]: > > <esi:vars> > > <% state = "$(GEO{'region_code'})" %> > > <% city = "$(GEO{'city'})" %> > > > > State: <%= state %><br/> # CT > > City: <%= city %><br/> # NEWHAVEN > > > > Massaged city: <%= CITIES[state][city] %> # Uses the literal EIS > > strings > > > > </esi:vars> > well, as far as ruby/erb is concerned there is no ESI, right? it > simply produces: > > <esi:vars> > > State: $(GEO{'region_code'}) > City: $(GEO{'city'}) > > Massaged city: > whatever-the-value-of-CITIES["$(GEO{'region_code'})"]["$(GEO{'city'})"]-is > > </esi:vars> > > the hash lookup occurs before ESI gets any chance to replace the > variables. so i don't think there's any way to achieve what you want > (other than going back to the server by some means after ESI > processing has happened). i'm totally unfamiliar with ESI, though, > so i might be off. > > What's odd is that both behaviors seem to happen: the Ruby variables being bound to the literal GEO strings, and the Ruby variables being bound to the ESI interpolations of those strings. So state and city display as CT and NEWHAVEN... but when used as hash keys, those same variables behave as the literal GEO strings. We solved the problem by doing it all in JavaScript :-) David -- The Ruby training with Black/Brown/McAnally Compleat Stay tuned for next event! Rubyist http://www.compleatrubyist.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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.