Sha256: 3c15c61775a8f7f86d69b7be2aed79a8cc9034b3da7bc6566c15ddc0e93dbad6

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

module Cavy
  module AdminItemGroupsHelper

    def form_path(params, id)
      if params[:action] == 'new' || params[:action] == 'create'
        return cavy_create_item_path(group_id: params[:group_id])
      elsif params[:action] == 'edit' || params[:action] == 'update'
        return cavy_update_item_path(id)
      end
    end

    def form_method(params)
      if params[:action] == 'new' || params[:action] == 'create'
        return 'post'
      elsif params[:action] == 'edit' || params[:action] == 'update'
        return 'patch'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cavy-0.1.0.beta1 app/helpers/cavy/admin_item_groups_helper.rb