https://github.com/tty47/rails-blog
Test application with Ruby on Rails
https://github.com/tty47/rails-blog
Last synced: 8 months ago
JSON representation
Test application with Ruby on Rails
- Host: GitHub
- URL: https://github.com/tty47/rails-blog
- Owner: tty47
- Created: 2021-10-30T14:46:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-30T16:40:27.000Z (over 4 years ago)
- Last Synced: 2025-04-08T14:21:22.762Z (about 1 year ago)
- Language: Ruby
- Size: 173 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby on Rails Blog
This is an example of a RoR application.
Here we will use the basic commands and create a CRUD application.
---
## Setup
To setup the project you will need:
Ruby:
```
ruby --version
```
SQLite3
```sqlite3
sqlite3 --version
```
Node
```
node --version
```
Yarn
```
yarn --version
```
---
## Install Rails
```ruby
gem install rails
```
Confirm it with:
```rails
rails --version
```
---
## Useful commands
```rails
# Setup new app
rails new blog
# Rails server commands
rails console
rails server
rails routes
# Generate Models
rails generate model Article title:string body:text
rails generate model Comment commenter:string body:text article:references
# Generate Controllers
rails generate controller Articles index --skip-routes
rails generate controller Comments
# Generate new migrations
rails generate migration AddStatusToArticles status:string
rails generate migration AddStatusToComments status:string
# DB migrations
rails db:migrate
# Tests commands
# Run specific test in line :X
rails test test/models/article_test.rb:8
# Run all the tests
rails test test/models/article_test.rb
```
---
## Sources
[Rails Guides](https://edgeguides.rubyonrails.org/getting_started.html)
---
Jose Ramón Mañes