def create
      authorize model

      @resource = model.new(creation_params)
      @resource.assign_attributes(**reflections_hash) unless reflections_hash.nil?

      # Customize the create behaviour
      before_create_hook(@resource)

      # TODO: Handle M2M relations in here
      if @resource.save
        after_create_hook(@resource)
        successful_response(:create)
      else
        errorful_resopnse(:create, @resource.errors) do
          redirect_to Rails.application.routes.url_helpers.send(@new_route)
        end
      end
    end
def create
      authorize model

      @resource = model.new(creation_params)
      @resource.assign_attributes(**reflections_hash) unless reflections_hash.nil?

      # Customize the create behaviour
      before_create_hook(@resource)

      # TODO: Handle M2M relations in here
      if @resource.save
        after_create_hook(@resource)
        successful_response(:create)
      else
        errorful_resopnse(:create, @resource.errors) do
          redirect_to Rails.application.routes.url_helpers.send(@new_route)
        end
      end
    end
The actual action method for creating new resource.