I apologize to all for being unclear. It's just the newbie coming out. Let's try again.
I have a 'projects' layout within the 'Views' folder, with a heading, nav bar, and content area. When you select "show" on the index.html.erb of the 'projects' View folder, the project information displays in the content area. I wish to not change this. Within another template, I have a link that produces a dialog box (Prototype Window) that displays the project information. When the dialog box appears, the project information displays as the first layout, with header, nav bar and content area. I created a layout for displaying just the content area and set it in the controller. - controller - def show @project = Project.find(params[:id]) render :layout => 'dialog' end When I go back to the original index.html.erb and click on the 'show' link, my 'header/nav bar/content area layout disappears. All that displays is the project information without any styling. I hope this clears up things. JohnM Colin Law wrote: > 2009/10/14 John Mcleod <rails-mailing-l...@andreas-s.net>: >> >> Hello all, >> I'm learning Ruby on Rails and still kind of new at this. >> >> I have two different layouts (standard page and dialog box) for a view >> (show). > > It is inadvisable to use the word layout here as that word has a > particular meaning in Rails. I take it that you mean that you have > two different ways that you want to show the same data. > >> else >> render :layout => 'dialog' >> >> end >> >> Where would I set the variable? in the show.html.erb? > > What is not clear is how you know which view you want to show. Does > the user do something to indicate which view he wants or is it > something else? Is it possibly that you want a different view when > just displaying the data from when the user is entering the data in > the first place (or editting it)? > > Colin -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---