Sha256: fe263105636b1155b59701ec84a86f64a77ee1667e1d83877048c8eb286728b4

Contents?: true

Size: 345 Bytes

Versions: 1

Compression:

Stored size: 345 Bytes

Contents

module RestfulController
  module Helpers
    extend ActiveSupport::Concern

    def model_params
      send("#{self.class.model_name}_params")
    end

    module ClassMethods
      def model_name
        controller_name.classify.downcase
      end

      def model_class
        controller_name.classify.constantize
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restful-controller-0.0.3 lib/restful_controller/helpers.rb