Options_for_select-how to store cookie selected value ques

#Controller

cookies[:state] = state

    if state != nil and state.to_i != -1
        conditions << 'stateid = ?'
        cond_args << state
        cookies[:state] = state
    end


    if !cookies[:state].blank?
        @default_state = cookies[:state]
    else
        @default_state = ""
    end

view - html

        State:
            <td><%= select_tag "stateid", 

options_for_select(@state_names, :selected => @default_state) %>

SOURCE OF HTML

     <td>State</td>

*** I WANT THE VALUE IN THE State value=“5.0” as the cookie.

            <td><select id="stateid" name="stateid">
Any OPEN CLOSED TEST

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs