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 CaseManagement < ActiveRecord::Base | |
has_one :service, as: :serviceable | |
has_many :treatment_plan_problems, dependent: :destroy | |
accepts_nested_attributes_for :treatment_plan_problems, allow_destroy: true | |
validates_associated :treatment_plan_problems | |
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
// I am using ajax to get an array of values which I want to turn into select options. | |
// When I log my array to console this is what I get: | |
Array[2], each item in the array looks like this: | |
Array[2] | |
0: "Abstain from substance abuse and participate in a recovery-based program." | |
1: 1 | |
1: Array[2] | |
0: "Engage in healthy, safe alternative activities to substance abuse that do not cause cognitive, behavioral, or emotional changes." |
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
// In the console log I can see that |
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
$(".desc-trigger").each(function() { | |
if ($(this).val == "1"){$(this).closest('.parent').find('.desc').show();} | |
else {$(this).closest('.parent').find('.desc').hide();} | |
}); |
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 self.get_group_times(school_id, group_number) | |
school = School.find(school_id) | |
var = group_number.to_i | |
return school."g#{var}start" # I need this to not be a string value it should be: school.g1start | |
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
def show | |
@intake_agreement = IntakeAgreement.find(params[:id]) | |
respond_to do |format| | |
format.html do | |
render layout: 'pdf' | |
end | |
format.pdf do | |
render pdf: 'filename', | |
layout: 'pdf', |
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
[root@ip-50-62-74-70 httpdocs]# RAILS_ENV=production rails console | |
/var/www/vhosts/eminencehc.net/httpdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/core_ext/object/try.rb:45:in `round': NaN (FloatDomainError) | |
from /var/www/vhosts/eminencehc.net/httpdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/core_ext/object/try.rb:45:in `public_send' | |
from /var/www/vhosts/eminencehc.net/httpdocs/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/core_ext/object/try.rb:45:in `try' | |
from /var/www/vhosts/eminencehc.net/httpdocs/app/models/missing_client_tests_calculation.rb:26:in `block in <class:MissingClientTestsCalculation>' | |
from /var/www/vhosts/eminencehc.net/httpdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each' | |
from /var/www/vhosts/eminencehc.net/httpdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in `each' | |
from /var/www/vhosts/eminencehc. |
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
if a.one == 1 | |
if foo.one == 1 || foo.two == 1 || foo.three == 1 | |
else | |
if bar.one == 1 || bar.two == 1 || bar.three == 1 | |
end | |
# Do something | |
else | |
# Do something else | |
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
@reviews = Review.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
<% if params[:referral_id].present? %> | |
<%= f.input :referral_id, input_html: {value: params[:referral_id]} %> | |
<% else %> | |
<%= f.input :referral_id %> | |
<% end %> |
NewerOlder