Hi Ignacio!
Sorry to bother you again:
The entries of a <sortable-collection> are not sorted according to entry
in :position column after update to 2.1.
Drag and drop still works, the records are updated in the database
correctly, but the <sortable-collection> displays it's records in the wrong
order (mayby by id or whatever Mysql gives back).
Entry in Log looks like this
Started GET "/admin/property_groups/1-technische-details" for 127.0.0.1 at
> 2013-12-30 13:26:59 +0100
> Processing by Admin::PropertyGroupsController#show as HTML
> Parameters: {"id"=>"1-technische-details"}
> User Load (0.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` =
> 664 LIMIT 1
> PropertyGroup Load (0.1ms) SELECT `property_groups`.* FROM
> `property_groups` WHERE `property_groups`.`id` = 1 LIMIT 1
> DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load
> a relation, you can call #load (e.g. `Post.where(published: true).load`).
> If you want to get an array of records from a relation, you can call #to_a
> (e.g. `Post.where(published: true).to_a`). (called from block in
> dev_user_changer at app/views/taglibs/application.dryml:28)
> User Load (0.2ms) SELECT `users`.* FROM `users` LIMIT 30
> Product Load (0.2ms) SELECT `products`.* FROM `products` WHERE
> `products`.`id` = 78 ORDER BY `products`.`id` ASC LIMIT 1
> Product Load (0.3ms) SELECT `products`.* FROM `products` LIMIT 100
> * (0.1ms) SELECT COUNT(*) FROM `properties` WHERE
> `properties`.`property_group_id` = 1*
>
> * Property Exists (0.2ms) SELECT 1 AS one FROM `properties` WHERE
> `properties`.`property_group_id` = 1 LIMIT 1 Property Load (0.1ms) SELECT
> `properties`.* FROM `properties` WHERE `properties`.`property_group_id` = 1*
> Rendered controller: admin/property_groups; dryml-tag: show-page
> (190.5ms)
> Completed 200 OK in 196ms (Views: 190.7ms | ActiveRecord: 1.4ms)
Property Group Model looks like this:
class PropertyGroup < ActiveRecord::Base
> hobo_model # Don't put anything above this
> fields do
> name_de :string, :required
> name_en :string
> position :integer, :required
> timestamps
> end
> attr_accessible :name_de, :name_en, :position, :product, :product_id,
> :properties
> has_many :properties, :accessible => true
> ...
> end
Property Model looks like this:
class Property < ActiveRecord::Base
> hobo_model # Don't put anything above this
> fields do
> name_de :string, :required
> name_en :string
> description_de :string
> description_en :string
> value :decimal, :precision => 10, :scale => 2
> unit_de :string
> unit_en :string
> position :integer
> legacy_id :integer
> timestamps
> end
> attr_accessible :name_de, :name_en, :description_de, :description_en,
> :value, :unit_de, :unit_en,
> :position, :property_group, :property_group_id,
> :legacy_id
> acts_as_list :scope => :property_group
> belongs_to :property_group
> ...
> end
app/views/taglibs/admin/property_group.dryml looks like this
<extend tag="show-page" for="PropertyGroup">
> <old-show-page merge>
> <append-content-body: >
> <div class="form-horizontal">
> <section param="collection-section" merge>
> <h3 param="collection-heading">
> <ht key="Property.collection.heading"
> count="&this.properties.count" >
> <human-collection-name collection="properties" your/>
> </ht>
> </h3>
> <sortable-collection:properties param/>
> </section>
> </div>
> </append-content-body: >
> </old-show-page>
> </extend>
Warm regards,
Stefan
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.