merlin371
merlin371

Reputation: 514

Rails link_to without ? symbols

I'm trying to create a user profile page what I'm looking for is to have

/profile/Nick

on the view I'm using

profile_path(:nick => current_user.nick)

While that works it does give me a link like

/profile?nick=Nick

the routes include

get 'profile/:nick' => 'users#show'

The routes work already if I write the address by hand, is just generating it not the way I would want it

is there a way to pass a parameter in a way that it will create a / instead of the old ?=

Thanks

Upvotes: 0

Views: 63

Answers (1)

Femaref
Femaref

Reputation: 61477

Use profile_path(current_user.nick) instead of what you have at the moment.

Upvotes: 2

Related Questions