ruby on rails - If statement on input select -
in form have
<!-- allow custom orders field --> <div class="control-group"> <label class="control-label">allow custom orders?</label> <div class="controls"> <%= f.select :allow_custom_orders, [["yes", 1], ["no", 2]], label: false %> </div> </div>
on show want check if "yes"
or "no"
selected , show button.
<% if @shop.allow_custom_orders = "1" %> <div> <small>need custom order?</small> <%= link_to "request custom order", "#", class: "btn btn-small btn-embossed btn-block btn-info" %> </div> <% end %>
but seems not work, suggestions ?
i'm new rails bear me :)
ok found out :) pretty simple
<% unless @shop.allow_custom_orders == 2 %>
Comments
Post a Comment