Sha256: 42be2c9b91a56e1fec3442c88a5cdc0e851ad4759575365ce14e53f1c9e280d0

Contents?: true

Size: 542 Bytes

Versions: 12

Compression:

Stored size: 542 Bytes

Contents

# makes the shorthand <%= render @posts %> work
# for collections of DataMapper objects
module ActionView
  module Partials
  alias :render_partial_orig :render_partial
  private
    def render_partial(options = {})
      if DataMapper::Collection === options[:partial]
        collection = options[:partial]
        options[:partial] = options[:partial].first.class.to_s.tableize.singular
        render_partial_collection(options.merge(:collection => collection))
      else
        render_partial_orig(options)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_dm_datastore-0.2.17.pre lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.16 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.15 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.14 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.13 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.12.pre lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.11.pre lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.10 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.9 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.8 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.6 lib/rails_dm_datastore/action_view.rb
rails_dm_datastore-0.2.5 lib/rails_dm_datastore/action_view.rb