Javascript For Select Input Field Get link Facebook X Pinterest Email Other Apps - December 08, 2019 JavaScript 'Select Input Field DEC 09/19 ‘ <script type="text/javascript"> $(document).ready(function() { $('input').attr('required', true); }); </script> Get link Facebook X Pinterest Email Other Apps Comments
User Validations - February 26, 2020 class User < ApplicationRecord has_secure_password validates :username, presence: true validates :username, uniqueness: true validates :username, length: { minimum: 4 } validates :email, presence: true validates :email, uniqueness: true validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i end Read more
Adding Auto Address from google map in registration form - February 14, 2020 Adding Auto Fill Address Form on Users registration form: HTML: <div class="col-lg-12"> <div id="locationField"> <input id="autocomplete" name="event[address]" placeholder="*Enter your address", required= "true" /> </div> </div> <table id="address"> <div class="col-md-6 col-sm-12"> <fieldset> <%= f.text_field :city, placeholder: "*Your City", id: "locality" %> </fieldset> </div> <div class="col-md-6 col-sm-12"> <fieldset> <%= f.text_field :state, placeholder: "*Your State"... Read more
Remove Product From Cart - September 19, 2019 Remove Product From Cart Step1-add this link into index.html.erb-carts <%= link_to "Remove", remove_cart_path(cart_item.product.id), data: {method: :delete, remote: true} %> Step2-Create a new method in product controller.rb def remove_cart @product = Product.friendly.find(params[:id]) @remove_cart = current_cart.cart_items.where(product_id: @product.id).first.destroy redirect_to "/carts" end Step3-Create a Routes path delete 'remove_cart_item/:id' => "products#remove_cart", as: :remove_cart Read more
Comments
Post a Comment