jeudi 20 août 2015

Get value from dropdown in div

Maybe this question is similar to others but I seriously can't find any solutions looking at others questions answers , I have a form in my view

    <%= form_tag list_campaigns_path, :method => 'get', :id => "country_search" ,remote: true  do %>

        <%= select_tag "search_by_country", options_for_select(@country.collect { |country|
        [country.name] }, params[:search_by_country]),{ prompt: "Select country" ,id: "select_country"} %> 

    <%= submit_tag "search", class: "btn grn btn-yel"%>

    <% end %>

what I'm trying to do is that when someone selects a country from dropdown say he selects US then after hitting on search button that selected country will be listed below with other search results that this is the country with you have performed your search. just a info:- i'm using country_select gem for getting countries list in dropdown

Aucun commentaire:

Enregistrer un commentaire