简体   繁体   English

如何覆盖Rails 3.2表单中的格式类型?

[英]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. 我的默认格式设置为json,但我想在用户从网站提交表单时覆盖它。

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)}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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