Skip to content

Instantly share code, notes, and snippets.

View faizaankhan's full-sized avatar
🐢
Slow and Steady

Faizaan Ahmed Khan faizaankhan

🐢
Slow and Steady
View GitHub Profile
# Rails Editor
- Point 1
- SubPoint B
- Point 2
- Subpoint D
- Point 3
[link to Facebook!](https://facebook.com)
if paperclip_cfg = YAML.load_file("#{Rails.root}/config/paperclip.yml")[Rails.env]
paperclip_cfg.symbolize_keys!
Paperclip::Attachment.default_options.merge!(paperclip_cfg)
end
https://codepen.io/lbebber/pen/rawQKR
https://codepen.io/Manoz/full/pydxK
https://codepen.io/anon/pen/ejpYwR
@faizaankhan
faizaankhan / SendgridRailsMail.rb
Last active July 20, 2018 06:23
Snedgrid API Integration in Rails 5 Application, add gem 'sendgrid-ruby' to GemFile
class SendgridWebMailer < ActionMailer::Base
require 'sendgrid-ruby'
include SendGrid
require 'json'
def initialize
@client = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']).client
end
def send_marketting_email(candidate)
require 'faker'
qp = QuestionPaper.new
qp.name = "QP-Test-React-Exam"
qp.save
4.times do
s = qp.sections.new
s.name = Faker::GameOfThrones.city
s.save
Mega Menu Codes
https://www.codeply.com/go/vZBG452NGf/bootstrap-4-megamenu
$(document).on('turbolinks:load', function() {
console.log("may i come")
if ( $(".quantity").length > 0 ) {
updateQuantity();
};
});
updateQuantity = () => {
$(".quantity").bind('keyup change click mouseup', function() {
const quantity = $(".quantity").val();
class AssociatesController < ApplicationController
before_action:authenticate_user!
def new
@associate= params || {}
@associate=Associate.new()
end
def index
if current_user[:role]=="associate"
Rails.application.routes.draw do
scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do
root to: 'associates#index'
end
devise_for :users
get 'welcome/index'
# patch 'associates/update'
get 'accept_request', to: 'associates#accept_request'
get 'cancel_request', to: 'associates#cancel_request'
<div class="navbar navbar-default navbar-static-top">
<div class="container">
<div>
<a class="navbar-brand" href="#" >Associate-Manager Interaction Portal</a>
<!-- <a class="navbar-brand" href="/"> -->
<!-- <a class="navbar-brand"
<%# <%= content_tag :li do %>
<%# <%= link_to 'Switch to English', locale: :en %> %>
<%# <% end unless current_page?(locale: :en) %> %>
<%# <%= content_tag :li do %> %>