你如何覆盖 form_for 助手中的类名? [英] How do you override the class name in the form_for helper?

查看:34
本文介绍了你如何覆盖 form_for 助手中的类名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在表单中添加一些类名.我正在使用 Rails 的 form_for 助手来做到这一点.我试过添加 { :class =>'classname' } 无济于事.

I need to add some class names to my form. I'm using Rails' form_for helper to do this. I've tried adding { :class => 'classname' } to no avail.

如何向此 Rails 帮助程序输出添加类?

How can I add classes to this Rails helper output?

推荐答案

试试这个:

form_for @order, :html => {:class => "foo"}

这篇关于你如何覆盖 form_for 助手中的类名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆