简体   繁体   中英

How to use custom path for form_tag?

I have these methods:

update_holidays  GET    /update_holidays(.:format)                     groups#update_holidays
                 POST   /update_holidays(.:format)                     groups#update_holidays
update_timespans GET    /update_timespans(.:format)                    subgroups#update_timespans
                 POST   /update_timespans(.:format)                    subgroups#update_timespans

and want to send data to them using a form_tag . How can I do this?


EDIT: My try on it was:

<%= form_tag({url: ##########, method: 'post'},{name: "exchange", id: "exchange"}) do %>

It's quite simple

form_tag(update_holidays_path, id: 'exchange', name: 'exchange')

and

form_tag(update_timespans_path, id: 'exchange', name: 'exchange')

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