ruby on rails - link_to for url with embedded parameters -


i'm still newish rails not sure on correct terms here but..

i'd see how use link_to helper when url has parameters embedded in structure.

such as:

http://example.com/appointments/2015/3/15 

which displays appointments day. how use link when know date need pass in part of url?

something like, link_to 'text', appointments_path(2015/3/15) or whatever is?

sorry i'm unsure terms here or else find better google

bonus: call type of parameters?

assuming have route dynamic segments like:

get '/appointments/:year/:month/:date', to: 'appointments#index', as: :appointments 

you pass year, month, , day parameters arguments path helper:

link_to appointments_path(year: 2015, month: 3, day: 15) 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -