Ruby on Rails how to realize the entire web site index

Recently discovered in learning Ruby on Rails, controller and action path format is controller/action.


But I have a question, the initial index is the whole website and how to achieve it.


Because our general web master index pages are generated dynamically. For example, ASP or.NET to open. But this index page is the root directory on the web.

In RoR, in the root directory of the web site index does not belong to any of the controler path, no controller provides dynamic index page content, how to realize dynamic content generation.

Started by Ralap at February 06, 2016 - 8:22 PM

RAILS is based on access controller to jump past.

Posted by Alvis at February 08, 2016 - 9:16 PM

config/routes.rb

Add
map.connect '/',:controller=>'say',:action=>'index'

OK no?

Posted by Aaron at February 10, 2016 - 9:23 PM


Looking for jesea
He can help you.: )

Posted by Goddard at February 21, 2016 - 9:38 PM

I usually don't have the index.html, can consider the establishment of a /main controller, the index.html directly to the past

Posted by Hugh at March 03, 2016 - 10:25 PM

Positive solutions of smallmaster

Posted by Geoff at March 04, 2016 - 10:40 PM

Ruby group: 42213245 to give you a five star group.

Posted by Marlon at March 12, 2016 - 11:05 PM

Ruby group: 42213245 to give you a five star group. Have a problem what technology, can be directly to the group discussion, consultation. Thank you.

Posted by Marlon at March 18, 2016 - 11:36 PM

Or through the routing control good is the smallmaster statement

Posted by Carter at March 20, 2016 - 12:02 AM

Agreed to the 2 floor, the beginner when too long for this trouble

Posted by Cornell at March 29, 2016 - 12:34 AM

map.connect '',:controller=>'main',:action=>'index'Can also be

Posted by Clarence at November 20, 2016 - 11:35 AM

The normal should be map.root

Posted by Clarence at November 21, 2016 - 12:19 PM

Have not encountered such a situation.

Posted by Tobias at November 22, 2016 - 1:08 PM

With a path to a file, map.connect '/', :controller=> 'user', :action => 'login'
Delete public/index.rhtml OK.

Posted by Loren at November 25, 2016 - 1:40 PM

Positive solutions
The default public index

Posted by Garfield at November 27, 2016 - 2:30 PM

Remove the default public index.

Posted by Juliana at December 07, 2016 - 3:12 PM

# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
´╝âThat is using login controller index remember to delete public/index.html
map.root :controller => "login"

Posted by Kevin at December 13, 2016 - 3:20 PM

MARK, go back to the additive group.

Posted by Benedict at December 14, 2016 - 3:57 PM

Pass by, cannot read. . . . . .

Posted by Camille at December 15, 2016 - 4:01 PM

Delete public index.html
And then in the routes.rb
Add to
map.root :controller => "The name of the Controller"

Posted by Cheryl at December 23, 2016 - 4:31 PM

Beginners can't

Posted by Lori at December 31, 2016 - 4:34 PM

Read this post, just know this forum has a lot of people Oh, why do I solve the problem so little.?
19, the effect is very good, but for a project to be divided into front and back, or to a lot of, when the route specified is much, advised LZ routing look good.

Posted by Kyle at January 06, 2017 - 5:20 PM

map.root :controller => :Name, :action => :index

Posted by Morgan at January 10, 2017 - 6:17 PM

routes.rb
map.root :controller => :Name, :action => :index

Posted by Morgan at January 13, 2017 - 7:01 PM

We should study up on routes.rb

Posted by Duke at January 13, 2017 - 7:59 PM