hi railers, I have a model/view/controller with many associations (20+). I would like to display the relative associations using AJAX, allowing the user to display the association his/her is interesting at a particular time. Is here any kind ajax tabs helper or some kind of tab widgets that I can easily incorporate into my rails application. regards, leon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/12020da9/attachment.html
Could you give an example of a model + association(s) and what you would like to show to the user? Do you want to display things associated with the user? Say you have two models: User (has_many :pets) Pet (belongs_to :user) And if a user clicks on a link called "show pets" he will see a list of his pets? That would be possible with link_to_remote: ---------------------- views/user/show.rhtml: ---------------------- <%= link_to_remote ''Show pets'', :url => {:controller => ''pets'', :action => ''list''}, :update => ''the-div'' %> <div id="the-div"></div> ---------------------- views/pets/list.rhtml: ---------------------- <ul> <% for pet in @pets %> <li><%= pet.name %></li> <% end %> </ul> ------------------------------- controllers/pets_controller.rb: ------------------------------- class PetsController < ApplicationController def list @pets = @user.pets end end If you click the "Show pets" link, you''ll see a list of pets in the div with id="the-div". But I have to say that it is better to load this list without AJAX. The user cannot use his back button to go to a previous list. -- Posted via http://www.ruby-forum.com/.
PHP has http://www.wassons.org/pajaj/public/widget/AjaxTabWidget.php On 1/9/06, Leon Leslie <leonleslie@gmail.com> wrote:> > hi railers, > > I have a model/view/controller with many associations (20+). I would like > to display the relative associations using AJAX, allowing the user to > display the association his/her is interesting at a particular time. Is here > any kind ajax tabs helper or some kind of tab widgets that I can easily > incorporate into my rails application. > > regards, > leon > > > > > >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/b45a389d/attachment.html
Sorry, but Rails is not a component oriented framework. So there are no widgets. Just try out the example code above and create more links like the "Show pets" link. But again, AJAX is NOT the way to load content. Just use normal requests (normal links) here. -- Posted via http://www.ruby-forum.com/.
Ah.... Could you give an example of a model + association(s) and what you would like to show to the user? class Organisation < ActiveRecord::Base # Associations has_many :addresses has_many :filed_documents has_many :alerts end class Company < Organisation # Associations has_many :secretaries has_many :incorporators has_many :directors has_many :receiver has_many :liquidator has_many :share_classes has_many :share_holders has_many :charges has_many :attorneys . . . end I like the example but I must confest that I am looking for some eye candy... On 1/9/06, Jules Jacobs <julesjacobs@gmail.com> wrote:> > Sorry, but Rails is not a component oriented framework. So there are no > widgets. > > Just try out the example code above and create more links like the "Show > pets" link. > > But again, AJAX is NOT the way to load content. Just use normal requests > (normal links) here. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/62879a20/attachment.html
So what is your problem??> Is here any kind ajax tabs helper or some kind of tab widgets that I can easily incorporate into my rails application.No, because: 1. Rails does not have widgets 2. You should NOT use AJAX for this 3. If you want, you CAN use link_to_remote, but link_to is better Why not try my example code? Just change user and pet to company and secretary.... -- Posted via http://www.ruby-forum.com/.
works On 1/9/06, Jules Jacobs <julesjacobs@gmail.com> wrote:> > So what is your problem?? > > > Is here any kind ajax tabs helper or some kind of tab widgets that I can > easily incorporate into my rails application. > > No, because: > > 1. Rails does not have widgets > 2. You should NOT use AJAX for this > 3. If you want, you CAN use link_to_remote, but link_to is better > > Why not try my example code? Just change user and pet to company and > secretary.... > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/d8f84911/attachment.html
Why not load all the data on one page into seperate divs then use javascript to show/hide those divs. That way you aren''t loading data via Ajax. -- Posted via http://www.ruby-forum.com/.
Perhaps you want to try http://phrogz.net/JS/Tabtastic/index.html ? I used this on sites with much information about participants, and the user might just click at the tab he needs. Beate
Hello everyone, I''ve dabbled with Ruby on Rails in the past, but have decided to jump in with both feet after 1.0 was released. Most of my previous development was Java / JSP. Could you elaborate on why this is a poor use of AJAX? I would consider the primary focus of the page to be the person, not their associated lists. As such, when I click on the back button, I''d rather to go directly back to the user list without having to go through each of the associated lists that I''ve viewed. If I wanted to view a particular associated list again I''d click on it''s tab instead. Even if it''s not what the user expected, this behavior seems more intuitive and is probably what they really wanted to happen anyway. - Scott On Jan 9, 2006, at 12:55 PM, Jules wrote:> If you click the "Show pets" link, you''ll see a list of pets in the > div > with id="the-div". > > But I have to say that it is better to load this list without AJAX. > The > user cannot use his back button to go to a previous list. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >- - - :: pixel@pixelfreak.net :: http://www.pixelfreak.net - - -
Scott I am thinking the same thing. "I would consider the primary focus of the page to be the person, not their associated lists." On 1/9/06, Scott Ahten <pixel@pixelfreak.net> wrote:> > Hello everyone, > > I''ve dabbled with Ruby on Rails in the past, but have decided to jump > in with both feet after 1.0 was released. Most of my previous > development was Java / JSP. > > Could you elaborate on why this is a poor use of AJAX? > > I would consider the primary focus of the page to be the person, not > their associated lists. As such, when I click on the back button, I''d > rather to go directly back to the user list without having to go > through each of the associated lists that I''ve viewed. If I wanted to > view a particular associated list again I''d click on it''s tab instead. > > Even if it''s not what the user expected, this behavior seems more > intuitive and is probably what they really wanted to happen anyway. > > - Scott > > On Jan 9, 2006, at 12:55 PM, Jules wrote: > > > If you click the "Show pets" link, you''ll see a list of pets in the > > div > > with id="the-div". > > > > But I have to say that it is better to load this list without AJAX. > > The > > user cannot use his back button to go to a previous list. > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > - - - > :: pixel@pixelfreak.net > :: http://www.pixelfreak.net > - - - > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060110/ddf5f98a/attachment.html
Thanks Beate Paland.* * On 1/10/06, Leon Leslie <leonleslie@gmail.com> wrote:> > Scott I am thinking the same thing. "I would consider the primary focus of > the page to be the person, not > their associated lists." > > On 1/9/06, Scott Ahten <pixel@pixelfreak.net> wrote: > > > > Hello everyone, > > > > I''ve dabbled with Ruby on Rails in the past, but have decided to jump > > in with both feet after 1.0 was released. Most of my previous > > development was Java / JSP. > > > > Could you elaborate on why this is a poor use of AJAX? > > > > I would consider the primary focus of the page to be the person, not > > their associated lists. As such, when I click on the back button, I''d > > rather to go directly back to the user list without having to go > > through each of the associated lists that I''ve viewed. If I wanted to > > view a particular associated list again I''d click on it''s tab instead. > > > > Even if it''s not what the user expected, this behavior seems more > > intuitive and is probably what they really wanted to happen anyway. > > > > - Scott > > > > On Jan 9, 2006, at 12:55 PM, Jules wrote: > > > > > If you click the "Show pets" link, you''ll see a list of pets in the > > > div > > > with id="the-div". > > > > > > But I have to say that it is better to load this list without AJAX. > > > The > > > user cannot use his back button to go to a previous list. > > > > > > -- > > > Posted via http://www.ruby-forum.com/. > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > - - - > > :: pixel@pixelfreak.net > > :: http://www.pixelfreak.net > > - - - > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > First they laugh at you, then they ignore you, then they fight you. > Then you win. > -- Mahatma Karamchand Gandhi >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060110/8f647fd1/attachment.html
Leon, I put together a tutorial for my method of doing Ajax Tabs. It''s very fresh, so I am sure someone will spot a bug or two. Though it''s not a widget or anything, it is pretty simple to do and gives you total control. I know it''s a bit late to reopen this thread, but I ran into the request while looking for a solution to my similar problem and figured someone might enjoy. http://flinn.activeintra.net/biscuit/Ajax%20Tabs/ I am interested in feedback. --flinn> hi railers, > > I have a model/view/controller with many associations (20+). I > would like to > display the relative associations using AJAX, allowing the user to > display > the association his/her is interesting at a particular time. Is > here any > kind ajax tabs helper or some kind of tab widgets that I can easily > incorporate into my rails application. > > regards, > leon-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/dbecb225/attachment-0001.html
wow... thank you.... I will get back to you with some feedback... On 1/24/06, Flinn Mueller <theflinnster@gmail.com> wrote:> > Leon, > I put together a tutorial for my method of doing Ajax Tabs. It''s very > fresh, so I am sure someone will spot a bug or two. Though it''s not a > widget or anything, it is pretty simple to do and gives you total control. > I know it''s a bit late to reopen this thread, but I ran into the request > while looking for a solution to my similar problem and figured someone might > enjoy. > > http://flinn.activeintra.net/biscuit/Ajax%20Tabs/ > > I am interested in feedback. > > --flinn > > hi railers, > > I have a model/view/controller with many associations (20+). I would like > to > display the relative associations using AJAX, allowing the user to display > the association his/her is interesting at a particular time. Is here any > kind ajax tabs helper or some kind of tab widgets that I can easily > incorporate into my rails application. > > regards, > leon > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/76860ada/attachment-0001.html