Anyone use this pdf ? Already ran into an error and checked O''Reilly site and there is no errata submitted to date. I''m getting an error in the first example (Yahoo search using REST) NoMethodError in Code#yahootest Showing *app/views/code/yahootest.rhtml* where line *#2* raised: undefined method `text'' for #<REXML::Text:0x388fb50> Controller - class CodeController < ApplicationController def yahootest query = CGI.escape("SEARCH TEXT") #URL encoded search value yahookey = "19571957" url = "http://api.search.yahoo.com/" + "WebSearchService/VI/webSearch?" + "appid=#{yahookey}&query=#{query}" + "&results=3&start=1" result = Net::HTTP.get(URI(url)) @doc = REXML::Document.new result end end View- <% @doc.root.each_element do |res| %> <b>Title:</b> <%= res[0].text.to_s %><br> <b>Summary:</b> <%= res[1].text.to_s %><br> <b>Link:</b> <a href="<%= res[2].text.to_s %>"><%= res[2].text.to_s %></a> <br><br> <% end %> ??? Anyone know what''s wrong Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
After changing some of the code for the Yahoo test and then trying the Google test, I''m getting 404 errors: Not Found `/code/googletest'' not found. ------------------------------ WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24) at localhost:3000 On 11/8/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Anyone use this pdf ? > Already ran into an error and checked O''Reilly site and there is no errata > submitted to date. > > I''m getting an error in the first example (Yahoo search using REST) > > NoMethodError in Code#yahootest > Showing *app/views/code/yahootest.rhtml* where line *#2* raised: > undefined method `text'' for #<REXML::Text:0x388fb50> > > Controller - > class CodeController < ApplicationController > > def yahootest > query = CGI.escape("SEARCH TEXT") #URL encoded search value > yahookey = "19571957" > url = "http://api.search.yahoo.com/ " + > "WebSearchService/VI/webSearch?" + > "appid=#{yahookey}&query=#{query}" + > "&results=3&start=1" > result = Net::HTTP.get(URI(url)) > @doc = REXML:: Document.new result > end > > end > > View- > <% @doc.root.each_element do |res| %> > <b>Title:</b> <%= res[0].text.to_s %><br> > <b>Summary:</b> <%= res[1].text.to_s %><br> > <b>Link:</b> <a href="<%= res[2].text.to_s %>"><%= res[2].text.to_s > %></a> > <br><br> > <% end %> > > ??? Anyone know what''s wrong > Stuart > > -- > http://en.wikipedia.org/wiki/Dark_ambient-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pretty weird after all was getting uninitialized constant in Application Controller bug . This is in 1.1.6 Updated to edge to finish off these two "quick" examples. Stuart On 11/8/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > After changing some of the code for the Yahoo test and then trying the > Google test, I''m getting 404 errors: > > Not Found `/code/googletest'' not found. > ------------------------------ > WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24) at localhost:3000 > > On 11/8/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Anyone use this pdf ? > > Already ran into an error and checked O''Reilly site and there is no > > errata submitted to date. > > > > I''m getting an error in the first example (Yahoo search using REST) > > > > NoMethodError in Code#yahootest > > Showing *app/views/code/yahootest.rhtml* where line *#2* raised: > > undefined method `text'' for #<REXML::Text:0x388fb50> > > > > Controller - > > class CodeController < ApplicationController > > > > def yahootest > > query = CGI.escape("SEARCH TEXT") #URL encoded search value > > yahookey = "19571957" > > url = " http://api.search.yahoo.com/ " + > > "WebSearchService/VI/webSearch?" + > > "appid=#{yahookey}&query=#{query}" + > > "&results=3&start=1" > > result = Net::HTTP.get(URI(url)) > > @doc = REXML:: Document.new result > > end > > > > end > > > > View- > > <% @doc.root.each_element do |res| %> > > <b>Title:</b> <%= res[0].text.to_s %><br> > > <b>Summary:</b> <%= res[1].text.to_s %><br> > > <b>Link:</b> <a href="<%= res[2].text.to_s %>"><%= res[2].text.to_s > > %></a> > > <br><br> > > <% end %> > > > > ??? Anyone know what''s wrong > > Stuart > > > > -- > > http://en.wikipedia.org/wiki/Dark_ambient > > > > > -- > http://en.wikipedia.org/wiki/Dark_ambient >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---