This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@day = BusinessProfile.where(:user_id => current_user).pluck(:days) | |
@days = @day.first | |
@days = @days.split(',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#id_country_code").change(function(){ | |
var option = $(this).val(); | |
$.ajax({ | |
type: "GET", | |
url: "/models/get", | |
data:{ | |
key: option | |
}, | |
success: function(response){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_action :check_have, only: [:new] | |
def check_have | |
if Profile.where(:user_id=>current_user.id).present? | |
redirect_to root_path | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Task < ApplicationRecord | |
belongs_to :todo_list, optional: true | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div><%= t = Time.parse(appointment.time) %> | |
<%= date = appointment.date %> | |
<%= d = Date.new(date.year,date.month,date.day) %> | |
<%= time = DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec) %></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tenant = Apartment.tenant_names | |
@tenant.each do |name| | |
Apartment::Tenant.switch(name) do | |
@email = Account.pluck(:email) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( document ).on('turbolinks:load', function() { | |
var deferentMonth = 0; | |
var prevEl = document.getElementById('ac-prev'), // get the ID of the prev month button | |
nextEl = document.getElementById('ac-next'), // get the date of the next month button | |
daysEl = document.getElementById("custom_calndar2"); | |
const months = [ | |
"JANUARY", | |
"FEBRUARY", | |
"MARCH", | |
"APRIL", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array = ["2019-06-01","2019-06-02","2019-06-03"]; | |
$('#inline-datepicker').datepicker({ | |
// minDate: 0, | |
beforeShowDay: function(date) { | |
var string = jQuery.datepicker.formatDate('yy-mm-dd', date); | |
return [ array.indexOf(string) == -1 ] | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data.with_schema('schema_name').all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def backup | |
models = ["table1s","table2s","table3s"] | |
all_data = Hash.new | |
models.map do |model_name| | |
table_data = [] | |
model_name = model_name.split("") | |
model_name.pop | |
model_name = model_name.join("") | |
model_name.camelize.constantize.all.map do |data| | |
table_data.push(data) |