Sha256: 03202f07aedf6d11017deb69d30d338a9fdaa33cbb2107ccc184af683dadee40

Contents?: true

Size: 1012 Bytes

Versions: 2

Compression:

Stored size: 1012 Bytes

Contents

module Sketchily
  module FormBuilderInstanceMethods
    def sketchily(method, options = {})
      @template.render(
        :partial => "sketchily/sketchily",
        :locals => {
          :template => @template,
          :object_name => @object_name,
          :method => method,
          :options => objectify_options(options)
        }
      )
    end

    alias_method :svg_edit, :sketchily
  end

  module ActionViewBaseInstanceMethods
    def sketchily(object_name, method, options = {})
      self.render(
        :partial => "sketchily/sketchily",
        :locals => {
          :template => self,
          :object_name => object_name,
          :method => method,
          :options => options
        }
      )
    end

    def svg_edit(object_name, method, options = {})
      sketchily(object_name, method, options)
    end
  end
end

ActionView::Helpers::FormBuilder.send :include, Sketchily::FormBuilderInstanceMethods
ActionView::Base.send :include, Sketchily::ActionViewBaseInstanceMethods

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sketchily-4.0.1 lib/sketchily/sketchily.rb~
sketchily-4.0.0 lib/sketchily/sketchily.rb~