Reputation: 2888
I am thinking about question in routing... I have for example following in URL:
example.com/john
and for this URL I did this in routes
match "*a" => "people#person"
and in controller def profile #I have "john" in params[:a] variable ... end
And know I am thinking, how to do following URL
example.com/john/something
How I should edit my routes and my controller for this shape of URL. I am newbie in Rails, and a bit confused yet in routing...
Thank you
Upvotes: 0
Views: 223
Reputation: 83680
match ":a(/:b)" => "people#person"
# controller
def person
a = params[:a]
b = params[:b]
end
Upvotes: 3