user211662
user211662

Reputation: 18427

selected for select

I have the following code

select "sales", "price", @salesprice, {: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

Upvotes: 0

Views: 1274

Answers (1)

Question Mark
Question Mark

Reputation: 3606

Should be:

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

with double quotes around the #{@sales}

Upvotes: 3

Related Questions