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!
on 2006-03-28 21:29
on 2006-03-28 21:47
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. <firstname.lastname@example.org> wrote: > (index.html), then realized I had to change the filename to rhtml. > Rails mailing list > email@example.com > http://lists.rubyonrails.org/mailman/listinfo/rails > -- Ben R. http://www.benr75.com
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