Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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