Hello There has been some interest building a Sales On Rails application designed to support (at least initially) the sales process. Does anyone have a convenient wiki page that could be donated to create a project page? I can then direct enquiries to the project page. Cheers Andrew Stuart
On Wed, 2005-07-06 at 16:26 +1000, Luke Burton wrote:> Hi there,Hi Luke,> I have been having a think about how best to implement a List Box in rails > that can handle ordering.Definatly something that can be done in a straight-forward way> The goal is to provide the user with a large list of items, then allow > them to rank the items. > > The items themselves are ActiveRecords with a has_and_belongs_to_many > relationship, so I''m thinking in the ''join'' table I may add a ''rank'' > column. In theory I should be able to sort by this column, in practice I > have no idea how I would make rails do this. >name your db field ''position'' instead of rank, and have a look at acts_as_list: http://wiki.rubyonrails.com/rails/show/ActsAsList> Should I use ajax to give the users instant feedback? Or perhaps a page > refresh on each button press?Ajax probably would be the way to go. Seem''s like I saw where http://script.aculo.us has drag-n-drop functionality, though I''ve not used it myself. I was noticing tonight that Netflix is doing some sort of ajax to allow me to drag-n-drop movies in my queue. If they can do it, I''m bloody well certain rails can :) G''luck, Howard
http://wiki.rubyonrails.com/rails/show/SalesOnRails Free as in beer AND speech -- Matt On Jul 6, 2005, at 2:18 AM, Andrew Stuart wrote:> Hello > > There has been some interest building a Sales On Rails application > designed > to support (at least initially) the sales process. > Does anyone have a convenient wiki page that could be donated to > create a > project page? I can then direct enquiries to the project page. > > > Cheers > > Andrew Stuart > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >Matt Pelletier pelletierm-A1PILTyJ15gXhy9q4Lf3Ug@public.gmane.org
Hi there, I have been having a think about how best to implement a List Box in rails that can handle ordering. The goal is to provide the user with a large list of items, then allow them to rank the items. The items themselves are ActiveRecords with a has_and_belongs_to_many relationship, so I''m thinking in the ''join'' table I may add a ''rank'' column. In theory I should be able to sort by this column, in practice I have no idea how I would make rails do this. I''m also interested in how best to implement this on the front end. Should I use some heavy javascript and then ''submit'' to capture the changes? Should I use ajax to give the users instant feedback? Or perhaps a page refresh on each button press? What kind of widget should I use? A html table, or perhaps a select widget with size=50 and some custom javascript buttons to change the rank of the items? And of course, as above, the problem then becomes communicating the changes to rails and making rails use the data for sorting. There are probably a lot of solutions to this problem. Rather than going trial and error, I would love to hear some feedback from the rails gurus to start with. (a solution I have used in the past in Perl was an input field next to each item, into which a numerical value could be entered that described the rank. The user could then hit ''submit'' to have everything re-ordered. It was workable, but clumsy, and I still don''t know how I would do it in rails with the join table ...) Regards, Luke. -- Luke Burton. Yes, questions. Morphology, longevity, incept dates.
> I have been having a think about how best to implement a List Box > in rails > that can handle ordering. > > The goal is to provide the user with a large list of items, then allow > them to rank the items.This is not a big deal, unless your list is *very* large. Are you talking 10 or 20 items? Or 100 or 1000 items?> > The items themselves are ActiveRecords with a has_and_belongs_to_many > relationship, so I''m thinking in the ''join'' table I may add a ''rank'' > column. In theory I should be able to sort by this column, in > practice I > have no idea how I would make rails do this.I''m not sure how the habtm relationship is actually relevant here. Are you saying these records have a habtm relationship to each other? Anyway, for ordering purposes, it seems irrelevant.> I''m also interested in how best to implement this on the front end. > Should > I use some heavy javascript and then ''submit'' to capture the changes?Have you seen how Backpack now allows drag-and-drop reordering of items via the script.aculo.us javascript library? Description of this feature: http://backpackit.com/weblog/archives/new_features_updates/ new_drag_and_drop_reordering_for_todos_and_notes.php Implementation in JS: http://script.aculo.us/drag-and-drop
Wait for 0.13 and look at the new ajax sortable list helpers. I think the videos are already out. Ben On Jul 6, 2005, at 3:22 AM, Lord Khaos wrote:> On Wed, 2005-07-06 at 16:26 +1000, Luke Burton wrote: >> Hi there, > Hi Luke, >> I have been having a think about how best to implement a List Box in >> rails >> that can handle ordering. > Definatly something that can be done in a straight-forward way >> The goal is to provide the user with a large list of items, then allow >> them to rank the items. >> >> The items themselves are ActiveRecords with a has_and_belongs_to_many >> relationship, so I''m thinking in the ''join'' table I may add a ''rank'' >> column. In theory I should be able to sort by this column, in >> practice I >> have no idea how I would make rails do this. >> > name your db field ''position'' instead of rank, and have a look at > acts_as_list: > http://wiki.rubyonrails.com/rails/show/ActsAsList > >> Should I use ajax to give the users instant feedback? Or perhaps a >> page >> refresh on each button press? > Ajax probably would be the way to go. Seem''s like I saw where > http://script.aculo.us has drag-n-drop functionality, though I''ve not > used it myself. > I was noticing tonight that Netflix is doing some sort of ajax to allow > me to drag-n-drop movies in my queue. If they can do it, I''m bloody > well > certain rails can :) > > G''luck, > Howard > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >