Forum: Ruby on Rails Change default index page

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.
Jacob Y. (Guest)
on 2009-05-01 12:18
Hello,
  Not sure if anyone can help me here. I have a page which I want to
make it the index page.

  The page is http://www.myweb.com:3000/bin/myindex.mxml.

  Yes, you can probably tell it's a Adobe Flex component - myindex.mxml.
I'm combining Flex and RubyOnRails.

  My question is: Is there a way to make that the default page to
display when people browse to http://www.myweb.com:3000/.

  Apreciate if anyone could help.

Regards,
Jay
Shaun K. (Guest)
on 2009-05-01 12:59
Jacob Y. wrote:
> Hello,
>   Not sure if anyone can help me here. I have a page which I want to
> make it the index page.
>
>   The page is http://www.myweb.com:3000/bin/myindex.mxml.
>
>   Yes, you can probably tell it's a Adobe Flex component - myindex.mxml.
> I'm combining Flex and RubyOnRails.
>
>   My question is: Is there a way to make that the default page to
> display when people browse to http://www.myweb.com:3000/.
>
>   Apreciate if anyone could help.
>
> Regards,
> Jay


Define a default route in routes.rb

ie
map.root '/bin/myindex.mxml'

..at least, thats how you would define a default controller/action as
the root, so I think it will probably apply to a static resource.
Dmitry S. (Guest)
on 2009-05-01 13:38
(Received via mailing list)
Not sure that the previous solution will work.

If the page is dynamic then, point root to the right controller and
action.
  map.root :controller => 'yourcontroller', :action => 'youraction'

If it's static then you'll better think twice if you need it, and if
you realy need then try one of the following things:
1. Symlink it to the /index.html
2. Try Apache DirectoryIndex, or nginx index directives, although I'm
not sure that they allow setting the default page in another
directory.
3. Use URL rewriting on the webserver level

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