From: Ravi Dtv Date: 2010-05-19T20:07:17+09:00 Subject: Re: passing values from partial to controller Gregor Panek wrote: > hi, > > pass your parameters to your partial like this: > <%=render :partial => 'users/grouprow' ,:collection => @groups%> > > > and when you want to call the parameters in your partial, you have to > call it by the name of your partial so it will be something like this: > > grouprow.id > grouprow.name > > > Greg Thanks Greg for the reply. I can display the values in my partial. My problem is I need to pass the values from my partial to the controller. I have a link, textbox and button in my partial. The link holds groupname. the textbox holds friendname. When I click Add button, the friend in the textbox should be added to the group and insert into the table. My def in controller Controller ---------------- def addfriendtogroups @f=User.find_by_login(params[:login]).id @g=Group.find_by_group_name(params[:group_name]).id @addfriend=GroupFriend.create(:user_id => current_user.id , :group_id => @g,:friend_id => @f) respond_to do |format| if @addfriend.save flash[:notice] = "Friend added to group successfully." format.html {redirect_to :back} end end end Please correct the def. Thanks. -- Posted via http://www.ruby-forum.com/.