Skip to content

Commit f895c0d

Browse files
committed
Update README.md
1 parent 6fe9687 commit f895c0d

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

README.md

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
1-
# README
1+
# Active Storage Test App
22

3-
This README would normally document whatever steps are necessary to get the
4-
application up and running.
3+
A Rails 8.1 application demonstrating Active Storage file uploads with Turbo Streams for real-time UI updates.
54

6-
Things you may want to cover:
5+
## Features
76

8-
* Ruby version
7+
- File upload with Active Storage
8+
- Real-time updates using Turbo Streams (no page refresh)
9+
- Display of uploaded files with download links
10+
- Visibility into Active Storage internals:
11+
- Attachments table (`active_storage_attachments`)
12+
- Blobs table (`active_storage_blobs`)
913

10-
* System dependencies
14+
## Requirements
1115

12-
* Configuration
16+
- Ruby 3.x
17+
- Rails 8.1
18+
- SQLite3
1319

14-
* Database creation
20+
## Setup
1521

16-
* Database initialization
22+
```bash
23+
# Install dependencies
24+
bundle install
1725

18-
* How to run the test suite
26+
# Setup database
27+
bin/rails db:create db:migrate
1928

20-
* Services (job queues, cache servers, search engines, etc.)
29+
# Start the server
30+
bin/rails server
31+
```
2132

22-
* Deployment instructions
33+
Visit `http://localhost:3000` to use the application.
2334

24-
* ...
35+
## Usage
36+
37+
1. Enter a name for your upload
38+
2. Select a file
39+
3. Click "Upload"
40+
41+
The file will be uploaded and all three tables will update instantly without page refresh:
42+
- **Uploaded Files** - Your Upload records with file download links
43+
- **Active Storage Attachments** - The join table linking records to blobs
44+
- **Active Storage Blobs** - File metadata (filename, content type, size, checksum)
45+
46+
## Project Structure
47+
48+
- `app/models/upload.rb` - Upload model with `has_one_attached :file`
49+
- `app/controllers/uploads_controller.rb` - Handles CRUD with Turbo Stream responses
50+
- `app/views/uploads/` - Views and Turbo Stream templates

0 commit comments

Comments
 (0)