Controller:ads_controller.rb class AdsController < ApplicationController def index @ads = Ad.find(:all) end def show @ad=Ad.find(params[:id]) (params[:id]) end end routeing: route.rb ActionController::Routing::Routes.draw do |map| map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' end action;index.html.erb <html> <head> <title>All Ads!!<title> </head> <body> <h1>All Ads!</h1> <ul> <% for ad in @ads %> <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> <% end %> </ul> </body> </html> any one know mebay application on head first rails...i am practicing that one. this application is all about displaying the list of adds to the users. see the above code to display the available ads on an index page .. but the list of names of ads not displaying when i run this application at "http://localhost:3000/ads" whats wrong ...can anybody help me pls... -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
are you able to see add by id and please paste here you log file output or error in deatils On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Controller:ads_controller.rb > > class AdsController < ApplicationController > > def index > @ads = Ad.find(:all) > end > > def show > @ad=Ad.find(params[:id]) > (params[:id]) > end > > end > > > routeing: route.rb > > ActionController::Routing::Routes.draw do |map| > map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' > map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' > end > > > action;index.html.erb > <html> > <head> > <title>All Ads!!<title> > </head> > <body> > <h1>All Ads!</h1> > <ul> > <% for ad in @ads %> > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> > <% end %> > </ul> > </body> > </html> > > > any one know mebay application on head first rails...i am practicing > that one. > this application is all about displaying the list of adds to the > users. > see the above code to display the available ads on an index page .. > but the list of names of ads not displaying when i run this > application > at "http://localhost:3000/ads" whats wrong ...can anybody help me > pls... > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Thanks: Rajeev sharma +919013155133 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
i am not abe to see any thing...just able to see a white page without even a single dot in it.. On Dec 1, 12:39 pm, rajeevsharma86 <rajeevsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> are you able to see add by id and please > paste here you log file output or error in deatils > > > > > > > > > > On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Controller:ads_controller.rb > > > class AdsController < ApplicationController > > > def index > > @ads = Ad.find(:all) > > end > > > def show > > @ad=Ad.find(params[:id]) > > (params[:id]) > > end > > > end > > > routeing: route.rb > > > ActionController::Routing::Routes.draw do |map| > > map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' > > map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' > > end > > > action;index.html.erb > > <html> > > <head> > > <title>All Ads!!<title> > > </head> > > <body> > > <h1>All Ads!</h1> > > <ul> > > <% for ad in @ads %> > > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> > > <% end %> > > </ul> > > </body> > > </html> > > > any one know mebay application on head first rails...i am practicing > > that one. > > this application is all about displaying the list of adds to the > > users. > > see the above code to display the available ads on an index page .. > > but the list of names of ads not displaying when i run this > > application > > at "http://localhost:3000/ads" whats wrong ...can anybody help me > > pls... > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > Thanks: > Rajeev sharma > +919013155133-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
onemore thing i am able to see by id like when i am at "http:// localhost:3000/ads/3" the add details are coming fine.. On Dec 1, 12:43 pm, kiran <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i am not abe to see any thing...just able to see a white page without > even a single dot in it.. > > On Dec 1, 12:39 pm, rajeevsharma86 <rajeevsharm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > are you able to see add by id and please > > paste here you log file output or error in deatils > > > On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Controller:ads_controller.rb > > > > class AdsController < ApplicationController > > > > def index > > > @ads = Ad.find(:all) > > > end > > > > def show > > > @ad=Ad.find(params[:id]) > > > (params[:id]) > > > end > > > > end > > > > routeing: route.rb > > > > ActionController::Routing::Routes.draw do |map| > > > map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' > > > map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' > > > end > > > > action;index.html.erb > > > <html> > > > <head> > > > <title>All Ads!!<title> > > > </head> > > > <body> > > > <h1>All Ads!</h1> > > > <ul> > > > <% for ad in @ads %> > > > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> > > > <% end %> > > > </ul> > > > </body> > > > </html> > > > > any one know mebay application on head first rails...i am practicing > > > that one. > > > this application is all about displaying the list of adds to the > > > users. > > > see the above code to display the available ads on an index page .. > > > but the list of names of ads not displaying when i run this > > > application > > > at "http://localhost:3000/ads" whats wrong ...can anybody help me > > > pls... > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > Thanks: > > Rajeev sharma > > +919013155133-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 1 December 2010 07:32, kiran <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Controller:ads_controller.rb > > class AdsController < ApplicationController > > def index > @ads = Ad.find(:all) > end > > def show > @ad=Ad.find(params[:id]) > (params[:id]) > end > > end > > > routeing: route.rb > > ActionController::Routing::Routes.draw do |map| > map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' > map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' > end > > > action;index.html.erb > <html> > <head> > <title>All Ads!!<title>That should be </title> at the end Colin> </head> > <body> > <h1>All Ads!</h1> > <ul> > <% for ad in @ads %> > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> > <% end %> > </ul> > </body> > </html> > > > any one know mebay application on head first rails...i am practicing > that one. > this application is all about displaying the list of adds to the > users. > see the above code to display the available ads on an index page .. > but the list of names of ads not displaying when i run this > application > at "http://localhost:3000/ads" whats wrong ...can anybody help me > pls... > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yes colin u r right...thank u...i am surprized to see it worked...a simple slash made all the difference how would u figure out this...anyway thanx.. On Dec 1, 2:43 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 1 December 2010 07:32, kiran <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > Controller:ads_controller.rb > > > class AdsController < ApplicationController > > > def index > > @ads = Ad.find(:all) > > end > > > def show > > @ad=Ad.find(params[:id]) > > (params[:id]) > > end > > > end > > > routeing: route.rb > > > ActionController::Routing::Routes.draw do |map| > > map.connect ''/ads/'', :controller=>''ads'', :action=>''index'' > > map.connect ''/ads/:id'', :controller=>''ads'', :action=>''show'' > > end > > > action;index.html.erb > > <html> > > <head> > > <title>All Ads!!<title> > > That should be </title> at the end > > Colin > > > > > > > > > </head> > > <body> > > <h1>All Ads!</h1> > > <ul> > > <% for ad in @ads %> > > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li> > > <% end %> > > </ul> > > </body> > > </html> > > > any one know mebay application on head first rails...i am practicing > > that one. > > this application is all about displaying the list of adds to the > > users. > > see the above code to display the available ads on an index page .. > > but the list of names of ads not displaying when i run this > > application > > at "http://localhost:3000/ads" whats wrong ...can anybody help me > > pls... > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 1 December 2010 10:09, kiran <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> yes colin u r right...thank u...i am surprized to see it worked...a > simple slash made all the difference how would u figure out > this...anyway thanx..I guess that it took the whole of the rest as the title, since the title had not been closed. You would have seen the problem if you had copied the complete html of the page (View, Page Source or similar in the browser) and pasted it into the w3c htlm validator website. It would have told you about the error. A good tip when something apparently very strange like this is happening is to look at the html source, you would then have seen that there was something there that should have been displayed but was not, this would have told you that it must be an error in the html rather than any subtle rails issue. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.