新手问题 怎么在 controller 里面控制 html 元素

hql123 · April 09, 2014 · Last by hql123 replied at April 09, 2014 · 1550 hits

我要在 controller 里面写一个判断,就是当结果集里面有数据的时候就自动填充 value,而且只读

<%= text_field_tag 'xxx', @your_result, disabled: true %>

#1 楼 @miclle 如果我数据不存在呢,我希望当不存在的时候文本是可编辑状态的,如果数据存在则填充不可编辑

你不会写 if else ?

#3 楼 @miclle 谢谢我解决叻

You need to Sign in before reply, if you don't have an account, please Sign up first.