- Generate new rails app using
--webpack
flag
rails new myApp --webpack=vue
Note:
- You can use
--webpack=angular
for angular application and--webpack=react
for react.
RAILS_ROOT = File.dirname(File.dirname(__FILE__)) | |
RAILS_ENV = "staging" | |
RUBY_PATH = "/home/rails/.rvm/rubies/ruby-1.9.3-p392/bin/ruby"# path of rails user | |
def generic_monitoring(w, options = {}) | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 10.seconds | |
c.running = false | |
c.notify = {:contacts => ['team'], :category => 'Start if processing running false'} | |
end |
require 'yaml' | |
require 'mysql' | |
@dbconfig = YAML.load(File.read('/home/dev/app/config/database.yml')) | |
@con = Mysql.new(@dbconfig["#{env}"]['host'], | |
@dbconfig["#{env}"]['username'], | |
@dbconfig["#{env}"]['password']) |
#example of scrapping information such as a listing from a website | |
#that list results in a container for each 'match' of the search criteria. | |
require 'nokogiri' | |
website = "www.example.com" | |
scrapped_info = Array.new | |
doc = File.open(ARGV[0]) { |f| Nokogiri::HTML(f) } | |
doc.css('.result-container').each do |x| |
def self.get_docs(some_input, required_docs, optional_docs, base_id = nil) | |
base_req = self.get_parameters_from_request(some_input) | |
user_department_id = some_input.user_department.try("id") || -1 | |
doc = Document.arel_table | |
dept = Department.arel_table | |
dept_rule = DepartmentRule.arel_table | |
dept_code = DepartmentRuleCode.arel_table | |
debt_state = DepartmentRuleState.arel_table |