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.