Sha256: 7f881314af54e00406b9a4598a28884ab6f7500fa9923341dee4ec8e3c5a1d62

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

require 'active_support'

require 'lazy_crud/version'
require 'lazy_crud/constants'
require 'lazy_crud/before_hook_methods'
require 'lazy_crud/class_methods'
require 'lazy_crud/instance_methods'

require 'responders'
require 'responders/json_responder'

module LazyCrud
  extend ActiveSupport::Concern

  include Constants
  include BeforeHookMethods
  include InstanceMethods

  included do
    # support buth rails view layer, and js framework
    respond_to :html, :json
    # uses custom json responder
    responders :json

    class_attribute :resource_class
    class_attribute :parent_class
    class_attribute :param_whitelist

    # crud hooks
    class_attribute :before_create_hooks
    class_attribute :before_update_hooks
    class_attribute :before_destroy_hooks
    # setting instance variables for actions and views
    before_action :set_resource, only: [:show, :edit, :update, :destroy]
    before_action :set_resource_instance, only: [:show, :edit, :update, :destroy]

    # set default Resource / Parent Resource if applicable
    set_default_resources
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lazy_crud-0.9.8.4 lib/lazy_crud.rb
lazy_crud-0.9.8.3 lib/lazy_crud.rb
lazy_crud-0.9.8.2 lib/lazy_crud.rb
lazy_crud-0.9.8.1 lib/lazy_crud.rb
lazy_crud-0.9.8.0 lib/lazy_crud.rb