Hii

In a partial I used button_to_remote for deleting record.

My record is deleted but message is not firing.

 <%= button_to_remote "Delete", :url => {:controller => "users" ,
:action => "deletegroup", :group_name=>grouprow.group_name}, :class =>
"submit_input_button rounded_corner" %>

Action in Controller
def deletegroup
   j=0
    puts "in delete group"
   puts params[:group_name]
   @grpfriends=[]

   @grp=Group.find_by_user_id_and_group_name(current_user.id
,params[:group_name])
   puts @grp.id

@grpfriends=GroupFriend.find_all_by_group_id_and_user_id(@grp.id,current_user.id)
   puts @grpfriends

   @grpfriends.each do |f|
   f.destroy
   j=j+1
   end

   @grp.destroy

   @msg="Group deleted successfully."

   respond_to do |format|
    flash[:erro...@errmsg
    flash[:notice] = @msg
    format.html {redirect_to :back}
    end

   end


Please help how I can display a success message "Group deleted
successfully."

Thank you.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to