Hello Colin, I did mean <% instead of <@ and I did have some identifiable text with each view name version. Just cut out what I thought was extraneous to the post. I looked at the development.log and it is clean. The only differences between the view name versions were the expected time/ session/performance/etc.
The thought occurred to me that perhaps the use of duplicate view names was the unlikely problem. I've used 'display' as a view name several times across different folders. But I renamed everything and eliminated this as an issue. So for now I am left with a Ruby on Rails app that just has a quirky bias against 'display' as a view name. There are plenty of alternative naming options and alternatives seem to work. So ultimately not a big deal, though I'll be carrying a niggling suspicion that something will pop up and bite me one day. Thank you much for the replies and support. As I indicated earlier, this forum serves as a sanity safety net that keeps me from doing regrettable things to my computer. If I ever turn up an explanation for the problem I will pass it on. Cheers, Bill On Jun 2, 4:24 am, Colin Law <clan...@googlemail.com> wrote: > 2009/6/1 zambezi <b.but...@overhydration.org>: > > > > > > > Hi to Colin, Jennifer and anyone else, > > > If nothing else, this forum serves as a sanity check. > > > My difficulty arose when I created an application wide template as a > > container for various views and attempted to pass a title variable to > > the template. None of my fiddling raised any errors. After reading > > your replies I went back to my application and sacrificed another hour > > to Ruby idiosyncracies. Here is what I've done and the results. > > > #-------- within layout/application > > class LinkController < ApplicationController > > def display > > @title = "title (display)" > > end > > def index > > @title = "title (index)" > > end > > def foo > > @title = "title (foo)" > > end > > end > > ---- > > <title><%= @title %></title> > > --- > > I created a view named 'display' with the above embedded Ruby and > > opened it in the browser. The title was BLANK. > > Next I renamed the view 'index' and opened it in the browser. The > > title appropriately showed "title (index)" > > Then I renamed the view 'foo' and again a BLANK title. > > I renamed the view back to 'index' and the title reappeared. > > > The above was with a template, so I decided to try the same fun > > experiment with a standalone view. And things got murkier. Views > > named 'index' and 'foo' display their titles. Views named 'display' > > are BLANK. > > > Just on the off chance that Ruby is weirder than I think, I checked > > the list of reserved words. No conflicts there. I also considered > > there might be something bizarre about the title tags, so just stuck a > > variable in the middle of the view <body> <@= @title %></body>. This > > just reproduced the earlier results. > > I presume you meant <%= rather than <@= > Did you include some fixed identifiable text in each view to check > that the correct view is being shown? > The possible name conflicts are not so much with Ruby (which would > generally give an error of some sort) but with Rails. Have you tried > other variable names? This is certainly not a general problem or we > would all be falling over it all the time. > Have you checked in the log file (/log/development.log) for any errors? > > > > > So there is the sad story. Help! I suppose I can just test all of my > > view names to see if they pass muster, but I am really hoping to > > eventually get to where Ruby is a time saver. > > > Any suggestions and/or comments on the instance variable behavior will > > be welcomed. > > > Bill --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---