开发者

How to use "carmen" gem?

开发者 https://www.devze.com 2023-04-12 04:00 出处:网络
i had installed the gem \"carmen\" successfully and also include it in my gem file, but when i write it\'s code in my view it gives error, here is my view:

i had installed the gem "carmen" successfully and also include it in my gem file, but when i write it's code in my view it gives error, here is my view:

<%= form_for(@contact) do |f| %>
   开发者_JAVA百科 <div class="field">
         <%= f.label :country %><br />
         <%= country_select(:country, "US") %> 
    </div>

  <div>
      <button type="submit" class="btn btn-green big"><img src= "images/add.png" />  Save</button>&nbsp;
                                                    <button type="reset" class="btn btn-gray big">Cancel</button>                                   </div>
<% end %>

I am just confused ,how can i populate a default country Like :india


You should check out the carmen-rails library. If you want IN to be the default then,

<%= f.country_select :country_code, {priority: %w(IN)} %>
0

精彩评论

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