Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalvarez2596/faker_gem
Some benchmark using faker to load data using multiple forms
https://github.com/dalvarez2596/faker_gem
Last synced: 3 days ago
JSON representation
Some benchmark using faker to load data using multiple forms
- Host: GitHub
- URL: https://github.com/dalvarez2596/faker_gem
- Owner: dalvarez2596
- Created: 2024-09-05T01:04:00.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T20:13:25.000Z (2 months ago)
- Last Synced: 2024-11-08T13:14:41.974Z (about 2 months ago)
- Language: Ruby
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Faker Gem Scaffolding Example
This repository is a Ruby on Rails application demonstrating the use of the Faker gem along with Rails scaffolding for a `Post` model.
## Features
- **Faker Gem**: Used to generate fake data for development and testing purposes.
- **Rails Scaffolding**: Provides a basic CRUD interface for the `Post` model.## Getting Started
### Prerequisites
- Ruby 3.2.2
- Rails 7.2.1
- SQLite3 (for the database)### Installation
1. **Clone the repository**
```git clone https://github.com/yourusername/your-repository-name.git cd your-repository-name ```
2. **Install dependencies**```bundle install ```
3. **Setup the database**
```rails db:create```
```rails db:migrate ```4. **Seed the database with fake data**
The Faker gem can be used to generate fake data. You can create seed data by running:
```rails db:seed```Or you can you just run :
```rails db:setup```### Usage
- **Start the Rails server**
```rails server```
``` rails s```
- Open your browser and navigate to `http://localhost:3000` to view the application.
- **Access the Posts scaffold**
You can interact with the `Post` model through the scaffolded views provided by Rails:
- List all posts: `http://localhost:3000/posts`
- Create a new post: `http://localhost:3000/posts/new`
- Edit a post: `http://localhost:3000/posts/:id/edit`
- Show a post: `http://localhost:3000/posts/:id`
- Delete a post: Available on the index and show views### Ruby and Rails Versions
- Ruby: 3.2.2
- Rails: 7.2.1