Chris Sherlock
Chris Sherlock

Reputation: 3133

In routes.rb, what does the "#" symbol mean?

In Ruby on Rails, what does the # symbol mean in the following:

root to: 'stores#index', as: 'store'

I've looked everywhere for an explanation, but just can't find anything! I'm sure it's quite simple.

Upvotes: 1

Views: 166

Answers (2)

Rahul garg
Rahul garg

Reputation: 9362

Refer here, the 'stores#index' would redirect to index action of stores controller

Upvotes: 1

Jim Pedid
Jim Pedid

Reputation: 2780

The # is used to denote that you are choosing the action (method) index from the controller (class) store. There's a little bit more to it than that, but essentially the store\index.html is routed to by the rails framework. This is part of the RESTful architecture.

Upvotes: 2

Related Questions