RailsCasts Pro episodes are now free!

Learn more or hide this

Artur's Profile

GitHub User: arturaugusto

Comments by Artur

Avatar

I created a migration to add a position:integer field, used a hidden_field inside partial with :class => 'position' and included this line of js before event.preventDefault() to the .add_fields event:
> $(this).prev().find('.position').val(time)

and on has_many association, i used

has_many :posts, :order => "position"