[Rails] Re: To create a Ruby on Rails app, does back-end need to occur before front-end?

2014-05-22 Thread Michael Lutsiuk
Let Matt to do just a frontend and send complete HTML/CSS to Sam. I'm ROR developer. I have such experience, and i like it, because i know how better to compose views and partials and i hate when non-ROR developers doing non-ROR things in my views :) Just let the ROR developer make html "live".

[Rails] Re: before_validate refactor question

2013-09-04 Thread Michael Lutsiuk
Instance of Question doesn't have attribute "key". If this is ActiveRecord, you maybe should make migration "add_column :questions, :key, :string", OR within class scope write "attr_accessor :key" среда, 4 сентября 2013 г., 15:17:47 UTC+3 пользователь Ruby-Forum.com User написал: > > But, even t

[Rails] Re: before_validate refactor question

2013-09-03 Thread Michael Lutsiuk
before_validation :capitalize_first_words def capitalize_first_words [:question, :correct_ans_1, :correct_ans_2, :correct_ans_3].each do |key| self.key = key.to_s.gsub(/^(\W*?[a-z])/) { |m| m.upcase } if !key.to_s.blank? end end Note the difference betweet

[Rails] Re: before_validate refactor question

2013-09-03 Thread Michael Lutsiuk
Maybe you mean this? before_validation :capitalize_first_words def capitalize_first_words [:question, :correct_ans_1, :correct_ans_2, :correct_ans_3].each do |key| self.key = key.gsub(/^(\W*?[a-z])/) { |m| m.upcase } if !key.blank? end end вторник, 3 сентября 2013 г.