0.0
No release in over a year
This gem provides a lightweight library that simplifies the controllers of your resources in a Rails application. It offers a set of intuitive and convenient methods for handling common CRUD operations, including creating, reading, updating, and deleting resources.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Prefab

A lightweight library for managing resources in your Rails application's controllers

Introduction

This gem provides a lightweight library that simplifies the controllers of your resources in a Rails application. It offers a set of intuitive and convenient methods for handling common CRUD operations, including creating, reading, updating, and deleting resources.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add prefab

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install prefab

Usage

Include Prefab::Base in your top-level controller.

class ApplicationController < ActionController::Base
  include Prefab::Base
end

That will give your other controllers access to the prefab class method. Then you can prefab your specific resources:

class PostsController < ApplicationController
  prefab :posts
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bradly/prefab.

License

The gem is available as open source under the terms of the MIT License.