SSH into Root
$ ssh root@123.123.123.123
Change Root Password
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' | |
require 'mina_sidekiq/tasks' | |
set :rails_env, 'production' | |
set :domain, 'YOUR_IP_OR_DOMAIN' | |
set :deploy_to, "/home/rails/#{rails_env}" | |
set :repository, 'git@github.com:fousa/<YOUR_REPOSITORY>.git' |
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
# An example demonstrating Gmail API via IMAP using gmail_xoauth gem | |
# Add this file to your rails project to use if you don't want to use this in rails project then require | |
require 'net/imap' | |
require 'gmail_xoauth' | |
class Gmail | |
attr_accessor :email, :access_token | |
def initialize(args) | |
email = args[:email] |
# lib/auction_core/lot_importer/csv.rb | |
# We use require_dependency in our app and have this file namespaced under lib. | |
# This file is the entry point for using the importer. | |
require 'parser' | |
module AuctionCore | |
module LotImporter | |
module Csv | |
def self.import(file_to_import = nil, _klass = Lot) | |
parser = Parser.new(file_to_import) |
<div class="wrapper"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="box"> | |
<% unless @products.blank? %> | |
<%= render 'search/products' %> | |
<% end %> | |
<% unless @vendors.blank? %> |
var ready = function () { | |
$('[data-toggle="tooltip"]').tooltip({ | |
placement: 'right', | |
}) | |
} | |
$(document).ready(ready); | |
$(document).on('page:load', ready); |
class LineItem < ActiveRecord::Base | |
belongs_to :quote | |
belongs_to :product | |
end |
class ProductsController < ApplicationController | |
after_action :verify_authorized, except: :import | |
def index | |
if params[:search] | |
# @products = Product.where("(model) LIKE (?)", "%#{params[:search]}") | |
elsif params[:tag] | |
@products = Product.tagged_with(params[:tag]) | |
elsif params[:id] |
-- views/settings/_products.html.erb | |
<div class="ibox-title"> | |
<h5>Import Products</h5> | |
<a class="collapse-link"><i class="fa fa-chevron-up"></i></a> | |
<a class=""><%= link_to "", products_path, class: "fa fa-times" %></a> | |
</div> | |
<div class="box-content"> | |
<p>A CSV file can be used to import products. The first row should be the column name. The following columns are allowed.</p> |