Forum: Ruby on Rails Homepage as index.rhtml, not index.html?

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.
Dan C. (Guest)
on 2006-03-28 21:29
Hi all,

I'm building my first Rails app.  Please forgive my ignorance as I get
acquainted with the technology.

What I'd like to do is have a form that the scaffolding created for me
appear on my home page.  It's just one text field, a submit button, and
some error messages.

I first tried to copy the code from the new.rhtml view into the homepage
(index.html), then realized I had to change the filename to rhtml.
Doing so seemed to confuse the Routing.

I also considered putting an iframe onto the homepage, but that seems
awkward to me.

Can someone please help a rookie?  Thanks!
Ben R. (Guest)
on 2006-03-28 21:47
(Received via mailing list)
Hi ~

.rhtml files are template files and are stored in the views folder.
.rhtml files will not be processed in the public directory.  What you
want to do is change the default route in your config/routes.rb file.

Something like:

map.connect "", :controller => "your_controller_here"

Hope this helps,

Ben


On 3/28/06, Dan C. <removed_email_address@domain.invalid> wrote:
> (index.html), then realized I had to change the filename to rhtml.
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Ben R.
http://www.benr75.com
Dan C. (Guest)
on 2006-03-28 22:29
Ben,

Perfect!  Thank you.

The section on config/routes.rb in Agile Web D. on Rails (pg.
291) was also helpful.

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