What do you want to save?
Add Code snippet
New code examples in category Ruby
-
Awgiedawgie 2022-03-15 05:00:27
how to delete database in rails
rake db:create # Create the database from DATABASE_URL or config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config) rake db:drop # Drops the database using DATABASE_URL or the current Rails.env (... Add solution -
Awgiedawgie 2022-03-14 14:00:15
how to get new line to display in rails
<%= obj.description %> Even though your value may be "One \t \n \n Two", it will show up on the screen as "One Two". To get those new line characters to actually separate the lines when displayed, you'll need to convert them... Add solution -
A-312 2022-03-06 14:30:11
split ruby
# no number splits on single whitespace myArray = "hello hello".split # / / is one white space # limit value is 2 myArray = "hello hello".split(/ /, 2) # -1 means no limit to the number of fields returned, myArray = "hello ... Add solution -
A-312 2022-03-06 13:15:16
ruby in array
>> ['Cat', 'Dog', 'Bird'].include? 'Dog' => true Add solution