Sha256: 51940f48f5176a4d0117b3328e5cd431bac26974807147eaa7b9c38b4ec57848

Contents?: true

Size: 460 Bytes

Versions: 24

Compression:

Stored size: 460 Bytes

Contents

module Riveter
  module CommandFormHelper
    def command_form_for(command, options={}, &block)
      command_class_name = command.class.name.underscore
      options = {
        :as => command_class_name.gsub(/_command$/, ''),
        :url => command_class_name.gsub(/_command$/, '')
      }.merge(options)

      respond_to?(:simple_form_for) ?
        simple_form_for(command, options, &block) :
        form_for(command, options, &block)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.0.5 app/helpers/riveter/command_form_helper.rb
riveter-0.0.4 app/helpers/riveter/command_form_helper.rb
riveter-0.0.3 app/helpers/riveter/command_form_helper.rb
riveter-0.0.1 app/helpers/riveter/command_form_helper.rb