Sha256: e4d0a3cd875c13d173e4ec2a9d219a99582f94b4047942d5b54dab0be8c27c53

Contents?: true

Size: 540 Bytes

Versions: 1

Compression:

Stored size: 540 Bytes

Contents

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

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