How to get started with creating a Rails app

・ Display on the screen

    1. Build the foundation for your app with Rails

$ rails 5.2.1 new app name -d mysql You can create the necessary files at once

  1. Create a routing def index end in config/routes.rb

  2. Create controller $ rails g controller filename contlloers/applocation_controller.rb HTTP method'filename'=>'filename # index'

  3. View file Create an index.html.erb file in app/views and

    Hello World!

・ Save to database

  1. Creating a database  rails db:create

  2. Model creation rails g model filename A migration file is created

    1. Creating a column Fill in the columns in db/migrate/file name.rb Column data type specification: Column name
  3. My Great  rails db:migrate

☆WEll DONE(^^♪☆

Recommended Posts

How to get started with creating a Rails app
How to get started with slim
How to get along with Rails
How to specify db when creating an app with rails
[Note] How to get started with Rspec
How to get started with Eclipse Micro Profile
Rails beginners tried to get started with RSpec
How to push an app developed with Rails to Github
How to delete a new_record object built with Rails
How to manually generate a JWT with Rails Knock
[How to insert a video in haml with Rails]
[Rails] Creating a new project with rails new
[Rails] I tried to create a mini app with FullCalendar
How to get started with Gatsby (TypeScript) x Netlify x Docker
How to get started with JDBC using PostgresSQL on MacOS
How to change app name in rails
[Rails6] Create a new app with Rails [Beginner]
How to insert a video in Rails
I tried to get started with WebAssembly
How to get boolean value with jQuery in rails simple form
How to rename a model with foreign key constraints in Rails
[rails] How to create a partial template
[Rails 5] Create a new app with Rails [Beginner]
How to build Rails 6 environment with Docker
How to interact with a server that does not crash the app
[Rails] How to log in with a name by adding a devise name column
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
[Rails] How to apply the CSS used in the main app with Administrate
How to make an app with a plugin mechanism [C # and Java]
Rails: How to write a rake task nicely
Let's get started with Java-Create a development environment ②
Let's get started with Java-Create a development environment ①
Downgrade an existing app created with rails 5.2.4 to 5.1.6
[Rails] How to write when making a subquery
[Rails] rails new to create a database with PostgreSQL
[Rails] How to create a graph using lazy_high_charts
[Swift] How to link the app with Firebase
How to implement a like feature in Rails
How to easily create a pull-down in Rails
[Rails] How to create a Twitter share button
[Rails] How to easily implement numbers with pull-down
How to build API with GraphQL and Rails
How to get resource files out with spring-boot
[Rails] How to build an environment with Docker
[Rails] How to get success and error messages
How to make a follow function in Rails
How to write Rails
How to uninstall Rails
Get started with Gradle
How to get the ID of a user authenticated with Firebase in Swift
[Rails] How to get rid of flash messages in a certain amount of time
How to store data simultaneously in a model associated with a nested form (Rails 6.0.0)
How to make batch processing with Rails + Heroku configuration
How to make a factory with a model with polymorphic association
How to run the SpringBoot app as a service
[Rails] How to create a signed URL for CloudFront
How to implement a like feature in Ajax in Rails
Rails / Ruby: How to get HTML text for Mail
How to make an almost static page with rails
I tried to get started with Spring Data JPA