search for: display_order

Displaying 5 results from an estimated 5 matches for "display_order".

2006 Jun 28
1
sortable lists, database update
...them into the order I want and have the database updated accordingly. I have an unordered list elsewhere in the application that works well, but for the images I cant get it working. In my controller I have: def updateorder params[:images].each_with_index { |id,idx| ProductImage.update(id, :display_order => idx) } render :text => ''Updated sort order'' end Then my view has: <div id="images" style="border: solid black 1px; width: 672px;"> <% @images.each do |image| %> <% if image.product_id == @product.id then %><img src="/...
2008 Aug 25
2
maths not working (can't get this)
...def self.all_courses find(:all) end def self.active_courses # find(:all) # find(:all, :conditions => ["active = ?", true], :order => ''created_at DESC'', :limit => 5) find(:all, :conditions => {:archive => false}, :order => ''display_order ASC'', :limit => 100) end def self.old_courses # find(:all) # find(:all, :conditions => ["active = ?", true], :order => ''created_at DESC'', :limit => 5) find(:all, :conditions => {:archive => true}, :order => ''created...
2006 Jun 22
0
sortable list doesn''t work on production server
...using ruby 1.8.4 with rails 1.1.2 on both machines. The only difference is from mac to RHEL4 Can anyone give me an idea of what could be the problem? In case you need it, this is the action: def sort @navigation = Navigation.find(:all) @navigation.each do |menu_item| menu_item.display_order = params[''menu-list''].index(menu_item.id.to_s) + 1 menu_item.save end render :nothing => true end This my view: <ul id="menu-list"> <% @navigation.each do |menu| %> <li id="item_<%= menu.id %>"> <div id="dr...
2006 Jun 16
1
sortable acts_as_tree with heirarchy
...39;'s the action: def change_hierarchy change_links params[:menu] end def change_links (links_hash) parent_id = links_hash[:id] || Link.root.id links_hash.each do |key, value| next if key == "id" link = Link.find (value[:id]) link.display_order = key link.parent_id = parent_id link.save change_links value end end Does anyone have a clue what''s my mess? -- Posted via http://www.ruby-forum.com/.
2018 Aug 06
2
Back to Xfce
On 08/06/2018 11:51 AM, Tony Schreiner wrote: > On Mon, Aug 6, 2018 at 11:33 AM Robert Moskowitz <rgm at htt-consult.com> > wrote: > >> >> On 08/06/2018 11:11 AM, Tony Schreiner wrote: >>> On Mon, Aug 6, 2018 at 10:55 AM Robert Moskowitz <rgm at htt-consult.com> >>> wrote: >>> >>>> Nicolas, >>>> >>>>