Hi I''m new to this forum and new to Rails so excuse me if this is a daft question. I''m following the ONLamp.com tuturial and all has been well untill changing the template for the recipes. I have followed the instructions and added this code to the controller: class RecipeController < ApplicationController scaffold :recipe def list @recipes = Recipe.find_all end end I have also created the list.rhtml file to the C:\rails\cookbook\app\views\recipe directory using the html supplied. However I now get this error when trying to view the recipe list: Template is missing Missing template ./script/../config/../app/views/recipe/list.rhtml I have tried re-doing all the above, and restarting the server....any ideas? TIA A -- Posted via http://www.ruby-forum.com/.
You need to have a list.rhtml file in your views/recipe/ directory. Rob On 5/24/06, Angela Hilton <angela.hilton@gmail.com> wrote:> > Hi > > I''m new to this forum and new to Rails so excuse me if this is a daft > question. > > I''m following the ONLamp.com tuturial and all has been well untill > changing the template for the recipes. I have followed the instructions > and added this code to the controller: > > class RecipeController < ApplicationController > scaffold :recipe > def list > @recipes = Recipe.find_all > end > end > > I have also created the list.rhtml file to the > C:\rails\cookbook\app\views\recipe directory using the html supplied. > > However I now get this error when trying to view the recipe list: > Template is missing > > Missing template ./script/../config/../app/views/recipe/list.rhtml > > I have tried re-doing all the above, and restarting the server....any > ideas? > > TIA > A > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- c++: the power, elegance and simplicity of a hand grenade http://www.migrob.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/21fc118b/attachment.html
Sorry glazed over the part where you said you had it, oops... On 5/24/06, Rob Merrell <robholio@gmail.com> wrote:> > You need to have a list.rhtml file in your views/recipe/ directory. > > Rob > > > On 5/24/06, Angela Hilton <angela.hilton@gmail.com > wrote: > > > > Hi > > > > I''m new to this forum and new to Rails so excuse me if this is a daft > > question. > > > > I''m following the ONLamp.com tuturial and all has been well untill > > changing the template for the recipes. I have followed the instructions > > and added this code to the controller: > > > > class RecipeController < ApplicationController > > scaffold :recipe > > def list > > @recipes = Recipe.find_all > > end > > end > > > > I have also created the list.rhtml file to the > > C:\rails\cookbook\app\views\recipe directory using the html supplied. > > > > However I now get this error when trying to view the recipe list: > > Template is missing > > > > Missing template ./script/../config/../app/views/recipe/list.rhtml > > > > I have tried re-doing all the above, and restarting the server....any > > ideas? > > > > TIA > > A > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > c++: the power, elegance and simplicity of a hand grenade > http://www.migrob.com >-- c++: the power, elegance and simplicity of a hand grenade http://www.migrob.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/ee1e257e/attachment-0001.html
> From: Angela Hilton <angela.hilton@gmail.com> > > class RecipeController < ApplicationController > scaffold :recipe > def list > @recipes = Recipe.find_all > end > end > > I have also created the list.rhtml file to the > C:\rails\cookbook\app\views\recipe directory using the html supplied. > > However I now get this error when trying to view the recipe list: > Template is missing > > Missing template ./script/../config/../app/views/recipe/list.rhtmlThis might be a long shot, but can you recheck your views/recipe folder ? Most text editors add an extn after the file name, when they save it. So you might have created a file called list.rhtml but it ended up being saved as list.rhtml.html. I ran into this sometime back. Hope that helps. Bharat
Rob Merrell wrote:> Sorry glazed over the part where you said you had it, oops...no problem - i stil acnt work it out. feel like i''m missing a really obviuos point! A -- Posted via http://www.ruby-forum.com/.
Hmmm, what does your directory structure look like inside of /apps? On 5/24/06, Angela Hilton <angela.hilton@gmail.com> wrote:> > Rob Merrell wrote: > > Sorry glazed over the part where you said you had it, oops... > > no problem - i stil acnt work it out. feel like i''m missing a really > obviuos point! > > A > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- c++: the power, elegance and simplicity of a hand grenade http://www.migrob.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/8a5bb49c/attachment.html
Hi Angela, Angela Hilton wrote: <snip>> However I now get this error when trying to view the recipe list: > Template is missing > > Missing template ./script/../config/../app/views/recipe/list.rhtmlIf you''re using Windows, I recommend you make doubly sure that your file is really named list.rhtml. I''ve seen folks have problems where Explorer was not set to the Detail view. They''d be seeing, for example, list.rhtml but when they set Explorer to the Detail view they could see that the real name was list.rhtml.txt or something. Fire back if that''s not the problem. Best regards, Bill