What do you want to save?
Add Code snippet
New code examples in category Ruby
-
Bmo 2021-11-20 10:47:18
rails g model
$ rails generate model Article title:string text:text Add solution -
Earth-angell 2021-11-20 03:20:23
ruby raise argumenterror
# raise ArgumentError, 'Put error message here' unless some_condition # example from source link def inverse(x) raise ArgumentError, 'Argument is not numeric' unless x.is_a? Numeric 1.0 / x end puts inverse(2) # 0.5 puts inverse('not a numbe... Add solution -
Drkay 2021-11-20 03:12:13
remove ascii characters from string ruby
s.gsub!(/\P{ASCII}/, '') Add solution -