user3213561
user3213561

Reputation: 369

Root route pointing to show action Rails 3

I have a one page site and the controller is called 'home'. The home page is rendered from the show action. I also have a slug column in the database record called 'home'.

I need to change root route so instead of www.example.com/home/1 it should be www.example.com

Can friendly_id handle this? Is there a better approach?

Upvotes: 0

Views: 58

Answers (2)

user3213561
user3213561

Reputation: 369

based on Kirti's question I moved everything in the index

Upvotes: 0

alex
alex

Reputation: 3742

Add

root to: 'home#show'

to the config/routes.rb file.

Upvotes: 2

Related Questions