Forum: Ruby on Rails Template is missing error.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andy_pd (Guest)
on 2007-03-01 12:52
(Received via mailing list)
Hello ,

I am using Rails 1.2.2 and Ruby 1.8.5.

According to what i have read rails redirects the request to a view
with the same name as the controller.
This is supposed to work even if you don't explicitly give a
render :template =>  call in your controller.

But some how this is not working.

I have store_controller.rb in controllers and store.rthml in layouts .
Yet Rails is complaining about a missing template.

am i missing something here ?

Thanks
Rimantas L. (Guest)
on 2007-03-01 12:58
(Received via mailing list)
> According to what i have read rails redirects the request to a view
> with the same name as the controller.
<...>

Well it is action, not controller. In case when action is not
specified Rails will
use 'index' as default.

> I have store_controller.rb in controllers and store.rthml in layouts .
> Yet Rails is complaining about a missing template.
> am i missing something here ?

Yep, your are missing app/views/store/index.rhtml ;)

Regards,
Rimantas
--
http://rimantas.com/
Andy_pd (Guest)
on 2007-03-01 13:08
(Received via mailing list)
Hello Rimantas,

Yes i am trying out the depot example from the rails book.
But i do have a index action in the store_controller.rb and also app/
views/store/index.rhtml
Also i am trying to use /app/views/layouts/store.rthml  for creating
the layout.

yet i am getting the error. any ideas?

Thanks
Rimantas L. (Guest)
on 2007-03-01 13:24
(Received via mailing list)
<...>
> Also i am trying to use /app/views/layouts/store.rthml  for creating
> the layout.
>
> yet i am getting the error. any ideas?

Well, weird, unless your file indeed has "rthml" extension. It should
be "rhtml" -
"t" and "h" are swapped :)


Regards,
Rimantas
--
http://rimantas.com/
Andy_pd (Guest)
on 2007-03-01 13:50
(Received via mailing list)
Hello Rimantas,

oops :)  am extremely sorry for this . i failed to notice something so
obvious.
yes its working fine now.

Thanks.
This topic is locked and can not be replied to.