简体   繁体   中英

How do I override the format type in a form for Rails 3.2?

My default format is set to json, as I want it to, however, i want to override it when a user submits a form from a website.

I would like to do the following in my form:

%form{ :method => 'POST', :action => a_path , options: [format: :html]}

Is there any way of doing this?

它是:

%form{ :method => 'POST', :action => api_quizzes_path(format: :html)}

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