[Rails] Application Errors w/ layout & custom view pages

Steven Smith ssmith at fiveruns.com
Sun Jan 1 02:29:35 GMT 2006


In the case of 1) the layout should be in app>views>layouts, not  
app>views>test>layouts and as pointed out in another reply, layout  
should be at the class level, not inside a method and you want  
@content_for_layout not content_for_layout.  For 2), what error are  
you getting specifically?  What's in your development.log?


On Dec 31, 2005, at 2:38 PM, John Taber wrote:

> 1) I get Rails Application Error when trying to use layout
>
> test_controller
> def list
>   layout "stdlayout"
> end
>
> in the views/test/layouts stdlayout.rhtml
> <html>
> <head><title>test</title></head>
> </body>
> <h1>Test</h1>
> <%= content_for_layout %>
> </body>
> </html>
>
> 2) I get Rails Application Error when trying to use a separate  
> display page
>
> I create a method in the test_controller
> def welcome
> end
>
> in test/views I create an html page called welcome.rhtml
>
> what am I missing ?  thanks.
>
>
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails



More information about the Rails mailing list