English 中文(简体)
铁路3:部分作业的田地,一旦正常或一次成为越轨产出,就可达到两倍。
原标题:Rails 3: fields_for partial renders twice, once normally and once as escaped output

部分使用田地。 部分合同使形式领域受到罚款,但随后将产出again<>/em>作为超文本。 The Code to calls the part is here (haml):

= fields_for "advertisement[versions_attributes][#{@advertisement.versions.size-1}]".to_sym, @version do |version_fields|
  = render :partial =>  advertisement_versions/fields , :locals => {:f => version_fields}

我先尝试使用——田地——干for,但无uck。 - 田间——以赢取为平方,造成同样的问题。

最佳回答
= fields_for "advertisement[versions_attributes][#{@advertisement.versions.size-1}]".to_sym, @version do |version_fields|
  = render :partial =>  advertisement_versions/fields , :f => version_fields

如果我不错的话,你也可以略去:partial =>

= render  advertisement_versions/fields , :f => version_fields
问题回答

我看到你已经尝试过,但我有同样的问题(把产出再次与超文本相提并论),有2.3.14条铁路。 排序

= fields_for .....

iii

- fields_for .....

这对我来说已经解决了。





相关问题
How to debug broken vim completefunc in haml files?

I m using rails.vim and I love how you can use ctrl-x ctrl-u in insert mode to autocomplete long method names like distance_of_time_in_words and accepts_nested_attributes_for. But for some reason it ...

ruby - if string is not contained within an array

I only want to output one anchor here. If the current_page is in the array I get two (.html and -nf.html). If it is not in the array I get as many anchors as there are items in the array. I am using ...

Feasibility of HAML + PHP/CakePHP

Is anyone using a HAML implementation for PHP like phpHaml or pHAML? Both projects have seen no activity for about 2 years, and both are < 1.0. Is it feasible/wise to use HAML for a large PHP ...

How can I use Haml with Catalyst?

Is it possible to use Haml instead of a templating engine with the Catalyst web framework?

Referencing a SASS file from HAML

How do I reference a .sass file from a .haml file? I have the following haml expression that will reference a .css file: %link{ href => /stylesheets/layout.css?cache=1 , rel => stylesheet ...

haml syntax - better way of writing this?

I have a config file full of this.... - if current_page.include? "test_string_one" - @total_index = 3 - @next_location = ../random_string/page0.html - @next_name = title 2 ...

haml syntax - better way of writing this?

There must be a better way of writing this- I m just not sure how (using staticmatic)- - if current_page.include? "0.html" - @current_index = 1 - if current_page.include? "1.html" - @...