Forum: Ruby on Rails using components to reuse code

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ede9af9957d2a60735d1fdb17d4286d9?d=identicon&s=25 antekirtt (Guest)
on 2006-05-29 14:51
the following is the code of the controller, under the dir
components/test/:


class Test::GroupsManController < ApplicationController


uses_component_template_root

def add_to_group
  	@account = Account.find_by_nick(@params[:nick])
	# render :text => "#{session[:account_id]}
#{Group.find(session[:group_id]).owner_id}"

 	if (session[:account_id] == Group.find(session[:group_id]).owner_id)
	 	Account.join_group(@account.id, session[:group_id])
# 		render_component (:controller => 'test/groups_man', :action =>
'group_list')
 		group_list
 	else
 		render :partial => 'group_error'
 	end

  end

 def group_list

	@group = Group.find(session[:group_id])
	@account = @group.accounts.find(:all)
   render :partial => 'group_list'

 end



the problem come when I want to render :partial => 'group_list'. It
seems that with partial( as well as link_to_remote), so using ajax,
there is a problem. Actually this code will update the whole page.

I read this topic in "components:pursuing the pipe dream". Maybe what
I'm trying to do is not completly supported ...

Antekirtt
This topic is locked and can not be replied to.