[Rails] Help with iterating over an array in a histogram

2015-09-11 Thread Calvin Fung
Hello there, I am currently going through the Ruby course in Codeacademy and we are going over histograms. There is a particular exercise (5/8 of Data Structures, Meet Iteration) that is giving me trouble. I do not understand the line of code that is in bold below. I've gone through the exercis

Re: [Rails] Validate uniqueness of association not working.

2015-09-11 Thread Luis
> Here is the code you ask Colin: _form simple_form_for @pcp do |f| = f.error_notification .form-inputs.row.col-md-12 = f.input :name = f.input :last = f.input :phone1 = f.input :phone2 = f.input :bod = f.input :esp =f.simple_fields_for :medhospitals do |ho

Re: [Rails] Application.js not being loaded

2015-09-11 Thread Colin Law
On 11 September 2015 at 12:12, Sheeka Patak wrote: > I'm using rails 4.1.8 with ruby 2.2.0 - it seems like my application.js > file is not being loaded. I put up a question on Stack Overflow > yesterday but it's getting little attention and it's a matter of some > urgency that I fix this. I have a

Re: [Rails] Validate uniqueness of association not working.

2015-09-11 Thread Colin Law
On 11 September 2015 at 16:43, Luis wrote: > Hi! > > I have the following classes for postgres rails 4 project : > > class Medhospital < ActiveRecord::Base > belongs_to :pcp > belongs_to :hospital > validates_uniqueness_of :pcp_id, :scope => :hospital_id > end > > class Pcp < ActiveRecord:

[Rails] How to improve code efficiency of my example

2015-09-11 Thread wbsurf...@yahoo.com
# I was just at a job interview and was asked to write a function that did a frequency of various words from a string. # I wrote something out on the board similar to my freq() method below. When I got home I coded this example up as # an exercise # # I was then asked how could I improve the eff

Re: [Rails] Hi, I just started learning about an hour a go and already need help. :-)

2015-09-11 Thread Scott Ribe
On Sep 11, 2015, at 9:00 AM, Nick Savage wrote: > > Any help would be appreciative and the way I learn I can not move on till I > know. > > puts "I will now count my chickens:'" > puts "Hens #{25 + 30 / 6}" > #how does that equal 30? > puts "Roosters #{100 - 25 * 3 % 4}" > #How does this equal

[Rails] Validate uniqueness of association not working.

2015-09-11 Thread Luis
Hi! I have the following classes for postgres rails 4 project : class Medhospital < ActiveRecord::Base belongs_to :pcp belongs_to :hospital validates_uniqueness_of :pcp_id, :scope => :hospital_id end class Pcp < ActiveRecord::Base has_many :scheds has_many :medhospitals, depende

Re: [Rails] Hi, I just started learning about an hour a go and already need help. :-)

2015-09-11 Thread Rob Biedenharn
> On 2015-Sep-11, at 11:00 , Nick Savage wrote: > > Okay I started with Learn the hard way with ruby. > My code is below and below each code is my question. > I guess I do not understand the identifiers because when I do them in my head > they dont add up. > > Any help would be appreciative an

[Rails] Hi, I just started learning about an hour a go and already need help. :-)

2015-09-11 Thread Nick Savage
Okay I started with Learn the hard way with ruby. My code is below and below each code is my question. I guess I do not understand the identifiers because when I do them in my head they dont add up. Any help would be appreciative and the way I learn I can not move on till I know. puts "I will n

[Rails] Application.js not being loaded

2015-09-11 Thread Sheeka Patak
I'm using rails 4.1.8 with ruby 2.2.0 - it seems like my application.js file is not being loaded. I put up a question on Stack Overflow yesterday but it's getting little attention and it's a matter of some urgency that I fix this. I have a simplified version of my project up on a public github repo

[Rails] How to use QuickbooksGateway for ActiveMerchant::Billing::QuickbooksGateway

2015-09-11 Thread Jai shanker
Hi, I am integrating QuickbooksGateway using ActiveMerchant gem, Used below code: config.after_initialize do ActiveMerchant::Billing::Base.mode = :test ::GATEWAY = ActiveMerchant::Billing::QuickbooksGateway.new( :consumer_key => 'xxx', :consumer_secret => 'xx