Posts

Showing posts from February, 2020

Login API with Rails

                                                                             Coming Soon

User Validations

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

ACTIVE ADMIN-CRUD

Image

Importent Notes;

1.Default Action with Column name in Active Admin: actions name : "Actions" 1.Add Filter with Assosiation in Model [Active Admin] class Review < ActiveRecord::Base belongs_to :event validates_presence_of :review end class Event < ActiveRecord::Base has_many :reviews end App/Admin/review.rb filter :event_street_address, as: :string, :label => 'City'

Show Reviews Box on Home with Slider

Image
<section class="recent-reviews"> <div class="container"> <div class="row"> <div class="title">Recent Reviews</div> <div class="slides"> <div class="slide"> <div class="col-md-12"> <div class="item"> <div class="ico-wrapper"> <img src="http://localhost:8080/img/avatars/file.jpeg" alt=""> </div> <div class="title"> <b>Adrian</b> reviewed a chumaround with <a href="#">Maya</a> in Medelin, Columbia </div> <div class="description"> <i class="fa fa-quote-left"></i> <i class="fa fa-quote-right"></i> <div> We had a great time chumming around with Maya. Even though our ...

Overide the Edit Form from Active Admin

Add this line Path: project/admin/form.rb It look like: ActiveAdmin.registsr Form do form do | f | f . inputs "Label" do f . input : name f . input : address1 # etc end end end

Adding Auto Address from google map in registration form

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"...

SHOWING ALL USERS ON GOOGLE MAP WITH COSTUME MARKER

Showing All User on google map with marker. Showing Available Shop On google map. On click on marker show shop detail with chatting button and shopping buttom <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAvuPSxdugPS2FJQibo-i78wVZHWgmKemk&libraries=places"></script> <script>   $(document).ready(function()   {     var locations = <%= raw @map_data.to_json %>;     console.log("Data", locations)    var searchBox = new google.maps.places.SearchBox(document.getElementById('map'));       google.maps.event.addListener(searchBox , 'place_changed' , function(){             var places = searchBox.getPlaces();             var bounds =  new google.maps.LatLngBounds();             var i,place;             for( i = 0; palce = places[i]; i++)       ...

Gradient Egg

Image
Edison's broken bulb #FFA69E #861657 Copy CSS 2 Schopenhauer's Joke #D7816A #BD4F6C Copy CSS 2 Obama's Resignation #5F0A87 #A4508B Copy CSS 4 Global Warming #20BF55 #01BAEF Copy CSS 5 Successful Immigrant #74F2CE #7CFFCB Copy CSS 6 Casey's Broken Camera #A40606 #D98324 Copy CSS 7 Jack Dorsey's stock #380036 #0CBABA Copy CSS 8 Fly UI Kit 👉🏽 Banking Investment Mobile UI Kit – £25 AD Homeless Man's Joy #E58C8A #EEC0C6 Copy CSS 9 Spotify's Free Features #80FF72 #7EE8FA Copy CSS 10 Hodor's Sentence #7EE8FA #EEC0C6 Copy CSS 11 Mars Conquest #EC9F05 #FF4E00 Copy CSS 12 Wozniak's Broken Heart #9FA4C4 #B3CDD1 Copy CSS 13 Ho...