The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jamiecramb (2) [Avatar] Offline
#1

Listing 3.3 "HTML with embedded Ruby for rendering the Tweets" includes the creation of a hyperlink that links to the same page but with a specific tag in the URL as a param which can then be used for filtering the search results:



<% TAGS.each do |tag| %>

< a href="/?tag=<%= tag %>"><%= tag %>

<% end %>



You need to escape / encode the tags that are used as part of the HREF otherwise the "#" in the tags gets counted by the browser as the URL fragment; e.g.



<% TAGS.each do |tag| %>

< a href="/?tag=<%= URI.escape(tag) %>"><%= tag %>

<% end %>

r2d2 (6) [Avatar] Offline
#2
Re: Listing 3.3 Tag filtering in viewer not working due to missing char escape
Thanks for this one.