Senior & Expert RoR Developers Discussion Forum by Nyros Technologies

HIRE Ruby on Rails Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Multiple Select Helper Plugin Usage

 
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> Plugins and Gems
View previous topic :: View next topic  
Author Message
sivakrishna.m



Joined: 01 Jan 2008
Posts: 160
Location: Narsipatnam

PostPosted: Wed Jul 01, 2009 3:13 am    Post subject: Multiple Select Helper Plugin Usage Reply with quote

Selecting multiple elements in a list is sometimes tricky. You may click inadvertably on one item of the list and lost all your previous selection. You are forced to use Ctrl (or Command) clicks to select more than one element.

Multiple Select Helper allows you to create easy to use list for multiple selections from array, hashes, collections or trees. The list is build using checkboxes so you can click easily and you will not lost the elements you clicked before. As drawback you lose the use of the keyboard in the "list".


This multiple selections are very useful in many to many relationships (has_and_belongs_to_many or has_many :through with no obligatory fields).

You can download this plugin at:

http://svn.ruido-blanco.net/multiple_select/trunk

You can find this information at:

http://ruido-blanco.net/blog/rails-multiple-select-helper-plugin

== Using Multiple Select Helper

When you want to store your list of checked options in a "habtm" relationship you could use something like:

# In the model
class Person < ActiveRecord::Base
has_and_belongs_to_many :cities
end

# In the view
<%=
collection_multiple_select(
'person', 'city_ids', City.find(:all), :id, :name
)
%>

# In the controller
@person.city_ids = params[:person][:city_ids]

And you will have all the fruits you have selected linked to the person you
are editing.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> Plugins and Gems
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts User defined classes and types of variables.
2 swaminadhan 25 Wed Mar 10, 2010 4:40 am
swaminadhan View latest post
No new posts Background & Introduction of ruby
0 Divya 30 Mon Mar 08, 2010 12:59 pm
Divya View latest post
No new posts i have lost the data in schema.rb file in rails application
0 Raja 38 Thu Mar 04, 2010 4:46 am
Raja View latest post
No new posts AlertPay
0 Raghu 27 Mon Mar 01, 2010 11:36 am
Raghu View latest post
No new posts have a problem while working with facebooker plugin
1 krishnakanth 30 Mon Mar 01, 2010 9:31 am
sharma I View latest post
No new posts Having issues while trying to run the application
1 sharma I 31 Mon Mar 01, 2010 8:56 am
swaminadhan View latest post
No new posts getting twitter tweets using twitter gem
0 sharma I 23 Mon Mar 01, 2010 8:21 am
sharma I View latest post
No new posts JavaScript functionality with Event handling class
0 umamahesh_nyros 22 Mon Mar 01, 2010 7:25 am
umamahesh_nyros View latest post
No new posts Differences between form_for and form_tag in rails
0 sharma I 36 Mon Mar 01, 2010 7:19 am
sharma I View latest post
No new posts uninitialized constant HomeController::Money
1 Akshay 40 Mon Mar 01, 2010 6:27 am
sharma I View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More