Skip to content

Commit

Permalink
New docs: Ruby on Rails & irb
Browse files Browse the repository at this point in the history
  • Loading branch information
at-github committed Feb 13, 2023
1 parent e254b89 commit e2d0a3b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Docs

* [mail](./mail.md)
* [bepo.md](./bepo.md)
* [docker.md](./docker.md)
* [fail2ban.md](./fail2ban.md)
* [iptables.md](./iptables.md)
* [mail](./mail.md)
* [irb.md](./irb.md)
* [jsx-ts.md](./jsx-ts.md)
* [mongodb.md](./mongodb.md)
* [mysql.md](./mysql.md)
* [nginx.md](./nginx.md)
* [postgresql.md](./postgresql.md)
* [ror.md](./ror.md)
* [irb.md](./irb.md)
* [shell.md](./shell.md)
* [symfony.md](./symfony.md)
* [vim.md](./vim.md)
7 changes: 7 additions & 0 deletions irb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# IRB

## See current configuration

```irb
IRB.conf
```
35 changes: 35 additions & 0 deletions ror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Ruby On Rails

## Controller

```shell
bin/rails generate controller Articles index [--skip-routes]
```

## Model

```shell
bin/rails generate model Article title:string body:text
```
> Model names are singular, because an instantiated model represents a single data record.
> To help remember this convention, think of how you would call the model's constructor:
> we want to write `Article.new(...)`, `not Articles.new(...)`.
[source](https://guides.rubyonrails.org/getting_started.html#mvc-and-you-generating-a-model)

### Add record

```shell
bin/rails console

entity = EntityClass.new(propertyOne: "value")
entity.save
entity
EntityClass.find(1)
EntityClass.all
```

## Routes

```shell
bin/rails routes
```

0 comments on commit e2d0a3b

Please sign in to comment.