简体   繁体   中英

Rails - Passing Parameters through link_to

I want to create an Add to Watchlist column + link after the description field ,so the selected movie to be stored on another rb. page from the admin section called "Watchlist".

The concept is similar to a Shopping Cart,passing the data from one page to another.

How's that possible in ActiveAdmin?

I would appreciate your hints and advices.

这一页

I'm not familiar with ActiveAdmin, but if your question is how to pass parameters through link_to, try this:

link_to 'Somewhere', some_path(param_1: 'foo', param_2: 'bar')

When you click through, the params should be present in the query string and in the params hash that Rails provides. You can pull out the values with:

params[:param_1]
params[:param_2]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM