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".
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
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
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 г.
4 matches
Mail list logo