542 questions
Drat!-Ruby has a Double Splat-Firmafon Developers Blog I saw .deff(**options) options#=>{:hoge=>AAA,:foo=>BBB}endfoge: AAA, foo: BBBand deff(options={}) options#=>{:hoge=>AAA,:foo=>B...
How can Ruby temporarily write the contents of a variable to a file?We handle hash or array, and we used to write it in JSON and parse it when we needed it, but as the capacity increases, it takes a l...
I'm learning how Ruby works from the beginning.http://docs.ruby-lang.org/ja/2.1.0/class/File.htmlWhat should I do to find out the read method?There are singular methods, but where are the non-specific...
In rails, we have created a function to use (pay) points (quantities).I would like to validate the amount of payment.Specifically, if the payment amount is below the account balance of the payment use...
When I deal with values from json, I always get confused because I don't know which of the following two patterns.hoge [:title]hoge.title< Assume that the value of the key is obtainedHandling hash whe...
Ruby is a beginnerhttp://ascii.jp/elem/000/001/255/1255878/ by referring to the site.I have created the following code.- Uh-huh-huh-huh-huh-huh-huh-huh-huh-huh-huhrequire minrubydefault(tree) case tr...
What do you want to solveWe are implementing a soccer player search function using ransack.Search by keyword is successful, but activecord cannot be searchedThe form data is going well, but I don't kn...
I would like the following values.10.0 → 101.5 → 1.5 In the following process, the value=1 instead of value=1.0, but Is there a better way? value = 10.0/10 (some calculation)if value==value.to_i value...
I'm usually used to Ruby, so when I use JavaScript to manipulate arrays, hashes, strings, etc., it's troublesome to look for or implement Ruby's method in JavaScript.So please let me know if there is ...
a=[1,2],[]]b = Array.new(a)b[1].push(b[0].pop)I want to change a to before and after b to Both become [[1], [2]]My mistake? Ruby's mistake?
« | - 25 - | » |
© 2024 OneMinuteCode. All rights reserved.