You can find out more about to_xml at Ryan Daigle??™s blog:
http://ryandaigle.com/articles/2007/4/13/what-s-new-in-edge-rails-a-more-flexibleto_
xml.
Next, let??™s take a look at the view that contains the Flash container for the chart
(Listing 5-18):
CHAPTER 5 n CONNECTING YOUR REPORTS TO THE WORLD 105
<%if @events.length>1%>
<% graph_params = { 'AllowScriptAccess'=>'SameDomain' } %>
<%=flashobject_tag "/flash/open-flash-chart.swf",
:size=>"850x400",
:parameters=>graph_params,
:variables=>{'data'=>"/performance/#{@game.id}
/#{@player.id}.text"} %>
<%else%>
<%=@player.name%> has no recorded data for <%=@game.name%>.
<%end%>
If the user/game combination has no data, the view displays a message to that effect.
If the user has selected a player and game, the view will use flashobject_tag??”provided
by the Flash Object plug-in??”to include a graph. The data for the graph comes from the
path /performance/game_id/player_id.text.
Although it??™s possible to include Flash objects directly in your HTML views using
EMBED tags, that??™s not a good idea.
Pages:
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164