Answers for "rails generate model"

2

rails g model

$ rails generate model Article title:string text:text
Posted by: Guest on October-02-2020
0

rails generate model

rails generate model Article title:string body:text


[Output]

invoke  active_record
create    db/migrate/<timestamp>_create_articles.rb
create    app/models/article.rb
invoke    test_unit
create      test/models/article_test.rb
create      test/fixtures/articles.yml
Posted by: Guest on August-30-2021
0

how to create new rails app

#first make sure you have rails installed, then...
rails new your_new_rails_app_name
Posted by: Guest on September-18-2020
1

rails controller generator

$ rails generate controller Welcome index
Posted by: Guest on October-30-2020
-1

rails command line

rails new app_name #creates a new rails application
rails server or rails s #runs the rails server
rails generate or rails g #gives a list of available generators 
rails console or rails c #opens up the rails console that allows you 
						 # to interact with your rails application
rails destroy or rails d #allows you to destroy what was previously created
# ex: rails g model Oops - creates
# ex: rails d model Oops - deletes what was created
rails about #gives info about your ruby application including the version, etc.
rails -T #opens up the rails tasks list to give you info on what you can run.
rails db: #most common command, allows you to run create or migrate
#ex: rails db:migrate - runs the migration
#ex: rails db:seed - seeds your DB from what was added in your seed file
Posted by: Guest on June-05-2020

Code answers related to "rails generate model"

Browse Popular Code Answers by Language