Sha256: 6e9515dd693acc6ac828ab0e504ed4ad709a529bd06c8cf8392a7212e816aceb

Contents?: true

Size: 1.6 KB

Versions: 59

Compression:

Stored size: 1.6 KB

Contents

<% show_fields||= "yes" %>
<%= form_for(@auth_shopping_cart, url: @auth_shopping_cart.new_record? ? carts_path : cart_path(@auth_shopping_cart), method: @auth_shopping_cart.new_record? ? :post : :put, namespace: @auth_shopping_cart.id.to_s) do |f| %>
  <%= render :partial => "auth/shared/object_errors.html.erb", locals: {active_model_object: @auth_shopping_cart} %>
  <div class="form_fields" style="<%= show_fields == "no" ? "display:none;" : "" %>">
    <% @auth_shopping_cart.class.attribute_names.keep_if{|c| !@auth_shopping_cart.field_names_to_skip_while_making_form.include? c.to_s}.each do |attr| %>
      <%=
          text_field_tag "cart[#{attr}]" ,@auth_shopping_cart.send("#{attr}"), :id => "#{@auth_shopping_cart.id.to_s}_cart_#{attr}" %>

      <%= 
          label_tag("#{@auth_shopping_cart.id.to_s}_cart_#{attr}")
      %>
    <% end %>
    <!-- add the add_cart_item_ids and remove_cart_item_ids as hidden fields -->
    <% @auth_shopping_cart.add_cart_item_ids.each do |ac_id| %>

    
    <%= hidden_field_tag("cart[add_cart_item_ids][]",ac_id.to_s, :id => "#{@auth_shopping_cart.id.to_s}_cart_add_cart_item_ids_#{ac_id.to_s}", :multiple => true) %>

    <% end %>

    <% @auth_shopping_cart.remove_cart_item_ids.each do |r_id| %>

      <%= hidden_field_tag("cart[remove_cart_item_ids][]",r_id.to_s, :id => "#{@auth_shopping_cart.id.to_s}_cart_remove_cart_item_ids_#{r_id.to_s}") %>

    <% end %>

    <% if @auth_shopping_cart.discount_id %>
    <%= hidden_field_tag("cart[discount_id]",@auth_shopping_cart.discount_id) %>
    <% end %>

  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.9 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.8 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.7 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.6 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.5 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.4 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.3 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.2 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.1 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.5.0 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.9 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.8 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.7 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.6 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.5 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.4 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.3 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.2 app/views/auth/shopping/carts/_form.html.erb
wordjelly-auth-1.4.0 app/views/auth/shopping/carts/_form.html.erb