Routes to index


(Tom) #1

I have a question,
In routes.rb,I see that

Discourse.filters.each do |filter|
    root to: "list##{filter}", constraints: HomePageConstraint.new("#{filter}"), :as => "list_#{filter}"
  end

so my www.example.com shall automatically route to www.example.com/list and then it shall look for an action latest in list_controller but I cant see any action like this in list_controller
Have I missed anything? Thanks


(Régis Hanol) #2

No, there’s no redirect.

That’s because these methods are dynamically generated


(Tom) #3

sprry so how does it route the root
I dont see any GET '/'
Thanks


(Régis Hanol) #4

Highly suggest that you learn more about how routing works in rails

http://guides.rubyonrails.org/routing.html#using-root