lundi 22 mai 2017

select option des not work in rails

I am trying to display the value have chosen, but it does not seem to be working. Any ideas?

Here is the code:

    <label>Apply to <%= statement_display_name.downcase %>:</label> <%= 
    f.select( :statement_id, 
    options_for_select(@client.statements.unpaid.collect { |statement| 
    [statement_display_name + " #{statement.number_with_prefix} #
    {statement.created_or_bill_date.to_date} - #
    {number_to_currency(statement.outstanding_amount)}"]}), :selected 
     => f.object.statement_id )%>

Aucun commentaire:

Enregistrer un commentaire