开发者

selected for select

开发者 https://www.devze.com 2022-12-15 16:19 出处:网络
I have the following code select \"sales\", \"price\", @sale开发者_开发知识库sprice, {:selected => \'#{@sales}\'}

I have the following code

select "sales", "price", @sale开发者_开发知识库sprice, {:selected => '#{@sales}'}

This is what is in @salesprice

[["All"], ["Sale"], ["Discount"], ["Free"]]

and when select something, and it renders the partial again, it returns whatever is this first element in the select tag :S

Any help is most appreciated, thank you


Should be:

select "sales", "price", @salesprice, {:selected => "#{@sales}"}

with double quotes around the #{@sales}

0

精彩评论

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