开发者

check_box_tag and params hash

I have some checkboxes like so in a form:

<%= check_box_tag "marked[#开发者_运维百科{relative_filepath}]", 1, false %>

Which produces:

<input type="checkbox" value="1" style="display: none;" name="marked[/blah]" id="marked__blah">

Now supposedly, I should there should be a hash in params[:marked], but this is nil.

What am I doing wrong?


From railsapi.com:

"The HTML specification says unchecked check boxes are not successful, and thus web browsers do not send them."

I usually use something like params[:object][:method].to_bool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜