search for: plans_control

Displaying 3 results from an estimated 3 matches for "plans_control".

Did you mean: place_control
2012 Sep 23
2
Find by id in the view template dynamically
...mn ''airline_id''. I would like to show the ''company'' name (string) in a template like <% @plans.each do |plan| %> Airline: <%= @airlines.find(plan.airline_id).first.company %><br /> ... <% end %> in the ''plans_controller.rb'', @plans = Plan.all @airlines = Airline.all Obviously this does not work although no error appears. It shows ''Airline'' all the same, where each plan should have a distinct airline company. Certainly the database stores the airline company names which c...
2012 Nov 12
7
RSpec: controller POST create
...validates :weight, :presence => true end The failure message is 1) PlansController POST create with valid params assigns a newly created plan as @plan Failure/Error: assigns(:plan).should be_persisted expected persisted? to return true, got false # ./spec/controllers/plans_controller_spec.rb:117:in `block (4 levels) in <top (required)>'' If my understanding is correct, be_persisted is testing if the newly created model instance is properly stored in DB. I understand that my way is rather opposite: building test methods after setting actual codes. But first...
2013 Feb 23
0
where condition having no association
...rential-association has_many :matches has_many :counterparts, :through => :matches has_many :inverse_matches, :class_name => "Match", :foreign_key => :counterpart_id has_many :inverse_counterparts, :through => :inverse_matches, :source => :plan and in the plans_controller, I would like to find a plan (counterpart) having many conditions. plans = Plan.arel_table @counterpart = Plan.where( .... ).where( plans[:user_id].not_eq(c...