I''m trying to update a list, and having a hard time applying visual effects to the latest element created. Here is what I''m doing. ==========================================1) Creating an "item" via an action, then rendering the RJS template 2) RJS template looks like this: page.insert_html :top, ''items'', :partial => ''item'' page.visual_effect :highlight, @item_id, :duration => 3 3) Once all this is done, I check the source of the page, and an item with the @item_id doesn''t exist in the HTML yet... as it''s just being ajaxed from the partial. If I refresh the page, it''s obviously there. ========================================== So, my question is... is there a clean way to create an effect on a newly created element in a list ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060307/926ee41e/attachment.html
Most browsers will give you the source of the original request back, not the source of the current page after ajax magic has happend. I think that one of the firefox developer plugins can give you the current source, so you might want to give that a shot. _Kevin On Tuesday, March 07, 2006, at 10:04 AM, Dylan Stamat wrote:>I''m trying to update a list, and having a hard time applying visual effects >to the latest element created. Here is what I''m doing. > >==========================================>1) Creating an "item" via an action, then rendering the RJS template >2) RJS template looks like this: > > page.insert_html :top, ''items'', :partial => ''item'' > page.visual_effect :highlight, @item_id, :duration => 3 > > >3) Once all this is done, I check the source of the page, and an item with >the @item_id doesn''t exist in the HTML yet... as it''s just being >ajaxed from >the > partial. If I refresh the page, it''s obviously there. >==========================================> >So, my question is... is there a clean way to create an effect on a newly >created element in a list ? > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails >-- Posted with http://DevLists.com. Sign up and save your time!
Dylan Stamat wrote:> 3) Once all this is done, I check the source of the page, and an item > with > the @item_id doesn''t exist in the HTML yet... as it''s just being ajaxedIt won''t show via "view source", since view source will only show the DOM elements when page is loaded, now the DOM elements are changed, but view source won''t show the change. Your example normally should work. If it doesn''t work, it could be: 1) If the new item is now showing, your partial tempatelate might not be rendered right, or the return result from it might break your DOM structure; 2) If the new item is added, but highlight is not working, variable @item_id might not be defined in the controller corresponding to your rjs template(not the one calling the rjs) -Tony -- Posted via http://www.ruby-forum.com/.
Thanks guys. Tony, you were right on #1... the DOM was, ever-so-slightly, broken ;) On 3/7/06, Tony Jin <jerommy@gmail.com> wrote:> > Dylan Stamat wrote: > > > 3) Once all this is done, I check the source of the page, and an item > > with > > the @item_id doesn''t exist in the HTML yet... as it''s just being ajaxed > > It won''t show via "view source", since view source will only show the > DOM elements > when page is loaded, now the DOM elements are changed, but view source > won''t > show the change. > > Your example normally should work. If it doesn''t work, it could be: > 1) If the new item is now showing, your partial tempatelate might not be > rendered > right, or the return result from it might break your DOM structure; > 2) If the new item is added, but highlight is not working, variable > @item_id might > not be defined in the controller corresponding to your rjs > template(not the > one calling the rjs) > > -Tony > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060307/25694de6/attachment.html
Kevin Olbrich wrote:> I think that one of the firefox developer plugins can give you the > current source, so you might want to give that a shot.http://jennifermadden.com/scripts/ViewRenderedSource.html
This is a gem. Thank you very much Ben ! On 3/7/06, Ben Munat <bent@munat.com> wrote:> > Kevin Olbrich wrote: > > I think that one of the firefox developer plugins can give you the > > current source, so you might want to give that a shot. > > http://jennifermadden.com/scripts/ViewRenderedSource.html > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060308/b232d3e1/attachment.html
having a bit of an issue here with rjs and partials i have the following controller/action: class Admin::UsersController < ApplicationController def new @user = User.new @permissions = Permission.find(:all) @action = "create" render :update do |page| page.replace_html("user_form_message", "") page.replace_html("user_form", :partial => "user_form", :locals => { :user => @user, :permissions => @permissions }) end end def edit @user = User.find(@params[:id]) @permissions = Permission.find(:all) @action = "update" render :update do |page| page.replace_html("user_form_message", "") page.replace_html("user_form", :partial => "user_form", :locals => { :user => @user, :permissions => @permissions }) end end end and the user_form partial: <%= form_remote_tag :url => { :controller => "/admin/users", :action => @action } %> <%= text_field :user, :login, :size => 10, :class => "field", :onfocus => " this.className=''field_selected''", :onblur => "this.className=''field''" %> <% permissions.each do |perm| -%> <%= check_box_tag "user[permission_ids][]", perm.id, @ user.permissions.include?(perm) -%><%= perm.description -%><br/> <% end -%> <%= text_field :user, :name, :size => 30, :class => "field", :onfocus => " this.className=''field_selected''", :onblur => "this.className=''field''" %> <%= submit_tag "Submit", :class => "button" -%> <input type="button" class="button" value="Cancel" onclick="Element.update(''user_form'', '''')" /> <%= hidden_field :user, :id %> <%= end_form_tag %> the problem i am having is that when the new action is rendered, the form is displayed empty as it should...but when the edit action is rendered, the user fields are still blank. it appears that the form fields are expecting to have @user accessible. if i remove the :locals from the render call (and change the partial to use the instance vars as well), rails complains that @permissions is empty, so it appears that the instance vars are not even available within the partial. is there a way to fix this behavior? Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/b2e67548/attachment.html
Are you using the RJS plugin or Edge rails? On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote:> having a bit of an issue here with rjs and partials > > i have the following controller/action: > > class Admin::UsersController < ApplicationController > def new > @user = User.new > @permissions = Permission.find (:all) > @action = "create" > render :update do |page| > page.replace_html("user_form_message", "") > page.replace_html("user_form", :partial => "user_form", :locals => { > :user => @user, :permissions => @permissions }) > end > end > > def edit > @user = User.find(@params[:id]) > @permissions = Permission.find(:all) > @action = "update" > render :update do |page| > page.replace_html("user_form_message", "") > page.replace_html("user_form", :partial => "user_form", :locals => { > :user => @user, :permissions => @permissions }) > end > end > end > > and the user_form partial: > > <%= form_remote_tag :url => { :controller => "/admin/users", :action => > @action } %> > <%= text_field :user, :login, :size => 10, :class => "field", :onfocus => > "this.className=''field_selected'' ", :onblur => "this.className=''field''" %> > <% permissions.each do |perm| -%> > <%= check_box_tag "user[permission_ids][]", perm.id, > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > <% end -%> > <%= text_field :user, :name, :size => 30, :class => "field", :onfocus => > "this.className=''field_selected''", :onblur => " this.className=''field''" %> > <%= submit_tag "Submit", :class => "button" -%> <input > type="button" class="button" value="Cancel" onclick=" > Element.update(''user_form'', '''')" /> > <%= hidden_field :user, :id %> > <%= end_form_tag %> > > > the problem i am having is that when the new action is rendered, the form is > displayed empty as it should...but when the edit action is rendered, the > user fields are still blank. it appears that the form fields are expecting > to have @user accessible. if i remove the :locals from the render call (and > change the partial to use the instance vars as well), rails complains that > @permissions is empty, so it appears that the instance vars are not even > available within the partial. is there a way to fix this behavior? > > Chris > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Cody Fauser http://www.codyfauser.com
plugin. On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote:> > Are you using the RJS plugin or Edge rails? > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > having a bit of an issue here with rjs and partials > > > > i have the following controller/action: > > > > class Admin::UsersController < ApplicationController > > def new > > @user = User.new > > @permissions = Permission.find (:all) > > @action = "create" > > render :update do |page| > > page.replace_html("user_form_message", "") > > page.replace_html("user_form", :partial => "user_form", :locals => > { > > :user => @user, :permissions => @permissions }) > > end > > end > > > > def edit > > @user = User.find(@params[:id]) > > @permissions = Permission.find(:all) > > @action = "update" > > render :update do |page| > > page.replace_html("user_form_message", "") > > page.replace_html("user_form", :partial => "user_form", :locals => > { > > :user => @user, :permissions => @permissions }) > > end > > end > > end > > > > and the user_form partial: > > > > <%= form_remote_tag :url => { :controller => "/admin/users", :action => > > @action } %> > > <%= text_field :user, :login, :size => 10, :class => "field", :onfocus > => > > "this.className=''field_selected'' ", :onblur => "this.className=''field''" > %> > > <% permissions.each do |perm| -%> > > <%= check_box_tag "user[permission_ids][]", perm.id, > > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > > <% end -%> > > <%= text_field :user, :name, :size => 30, :class => "field", :onfocus > => > > "this.className=''field_selected''", :onblur => " this.className=''field''" > %> > > <%= submit_tag "Submit", :class => "button" -%> <input > > type="button" class="button" value="Cancel" onclick=" > > Element.update(''user_form'', '''')" /> > > <%= hidden_field :user, :id %> > > <%= end_form_tag %> > > > > > > the problem i am having is that when the new action is rendered, the > form is > > displayed empty as it should...but when the edit action is rendered, the > > user fields are still blank. it appears that the form fields are > expecting > > to have @user accessible. if i remove the :locals from the render call > (and > > change the partial to use the instance vars as well), rails complains > that > > @permissions is empty, so it appears that the instance vars are not even > > available within the partial. is there a way to fix this behavior? > > > > Chris > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/f5ee24ab/attachment.html
Chris, I thought so. I just added the patch from the trunk that fixed that. Try updating your plugin. You should get Rev 18. On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote:> plugin. > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > Are you using the RJS plugin or Edge rails? > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > having a bit of an issue here with rjs and partials > > > > i have the following controller/action: > > > > class Admin::UsersController < ApplicationController > > def new > > @user = User.new > > @permissions = Permission.find (:all) > > @action = "create" > > render :update do |page| > > page.replace_html("user_form_message", "") > > page.replace_html("user_form", :partial => "user_form", :locals => { > > :user => @user, :permissions => @permissions }) > > end > > end > > > > def edit > > @user = User.find(@params[:id]) > > @permissions = Permission.find(:all) > > @action = "update" > > render :update do |page| > > page.replace_html("user_form_message", "") > > page.replace_html("user_form", :partial => "user_form", :locals => { > > :user => @user, :permissions => @permissions }) > > end > > end > > end > > > > and the user_form partial: > > > > <%= form_remote_tag :url => { :controller => "/admin/users", :action => > > @action } %> > > <%= text_field :user, :login, :size => 10, :class => "field", :onfocus => > > "this.className=''field_selected'' ", :onblur => "this.className=''field ''" > %> > > <% permissions.each do |perm| -%> > > <%= check_box_tag "user[permission_ids][]", perm.id, > > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > > <% end -%> > > <%= text_field :user, :name, :size => 30, :class => "field", :onfocus => > > "this.className=''field_selected''", :onblur => " this.className=''field''" %> > > <%= submit_tag "Submit", :class => "button" -%> <input > > type="button" class="button" value="Cancel" onclick=" > > Element.update(''user_form'', '''')" /> > > <%= hidden_field :user, :id %> > > <%= end_form_tag %> > > > > > > the problem i am having is that when the new action is rendered, the form > is > > displayed empty as it should...but when the edit action is rendered, the > > user fields are still blank. it appears that the form fields are > expecting > > to have @user accessible. if i remove the :locals from the render call > (and > > change the partial to use the instance vars as well), rails complains that > > @permissions is empty, so it appears that the instance vars are not even > > available within the partial. is there a way to fix this behavior? > > > > Chris > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Cody Fauser http://www.codyfauser.com
Cody, maybe i''m doing something wrong here, so forgive me. $> script/plugin update javascript_generator_templates Updating plugin: javascript_generator_templates svn: ''javascript_generator_templates'' is not a working copy i originally installed using the command script/plugin install javascript_generator_templates i guess i could do a remove and install again, i just want to make sure i''m doing it the correct way. On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote:> > Chris, > > I thought so. I just added the patch from the trunk that fixed that. > Try updating your plugin. You should get Rev 18. > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > plugin. > > > > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > > > Are you using the RJS plugin or Edge rails? > > > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > > having a bit of an issue here with rjs and partials > > > > > > i have the following controller/action: > > > > > > class Admin::UsersController < ApplicationController > > > def new > > > @user = User.new > > > @permissions = Permission.find (:all) > > > @action = "create" > > > render :update do |page| > > > page.replace_html("user_form_message", "") > > > page.replace_html("user_form", :partial => "user_form", :locals > => { > > > :user => @user, :permissions => @permissions }) > > > end > > > end > > > > > > def edit > > > @user = User.find(@params[:id]) > > > @permissions = Permission.find(:all) > > > @action = "update" > > > render :update do |page| > > > page.replace_html("user_form_message", "") > > > page.replace_html("user_form", :partial => "user_form", :locals > => { > > > :user => @user, :permissions => @permissions }) > > > end > > > end > > > end > > > > > > and the user_form partial: > > > > > > <%= form_remote_tag :url => { :controller => "/admin/users", :action > => > > > @action } %> > > > <%= text_field :user, :login, :size => 10, :class => "field", > :onfocus => > > > "this.className=''field_selected'' ", :onblur => "this.className=''field''" > > %> > > > <% permissions.each do |perm| -%> > > > <%= check_box_tag "user[permission_ids][]", perm.id, > > > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > > > <% end -%> > > > <%= text_field :user, :name, :size => 30, :class => "field", :onfocus > => > > > "this.className=''field_selected''", :onblur => " this.className=''field''" > %> > > > <%= submit_tag "Submit", :class => "button" -%> <input > > > type="button" class="button" value="Cancel" onclick=" > > > Element.update(''user_form'', '''')" /> > > > <%= hidden_field :user, :id %> > > > <%= end_form_tag %> > > > > > > > > > the problem i am having is that when the new action is rendered, the > form > > is > > > displayed empty as it should...but when the edit action is rendered, > the > > > user fields are still blank. it appears that the form fields are > > expecting > > > to have @user accessible. if i remove the :locals from the render > call > > (and > > > change the partial to use the instance vars as well), rails complains > that > > > @permissions is empty, so it appears that the instance vars are not > even > > > available within the partial. is there a way to fix this behavior? > > > > > > Chris > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > -- > > Cody Fauser > > http://www.codyfauser.com > > _______________________________________________ > > > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/6f3d93a2/attachment-0001.html
Chris, Maybe just nuke the javascript_generator_templates folder and re-install the plugin using script/plugin install javascript_generator_templates. The install must have done an svn export and not an svn checkout. On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote:> Cody, > > maybe i''m doing something wrong here, so forgive me. > > $> script/plugin update javascript_generator_templates > Updating plugin: javascript_generator_templates > svn: ''javascript_generator_templates'' is not a working copy > > i originally installed using the command > > script/plugin install javascript_generator_templates > > i guess i could do a remove and install again, i just want to make sure i''m > doing it the correct way. > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > Chris, > > I thought so. I just added the patch from the trunk that fixed that. > Try updating your plugin. You should get Rev 18. > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com > wrote: > > plugin. > > > > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > > > Are you using the RJS plugin or Edge rails? > > > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > > having a bit of an issue here with rjs and partials > > > > > > i have the following controller/action: > > > > > > class Admin::UsersController < ApplicationController > > > def new > > > @user = User.new > > > @permissions = Permission.find (:all) > > > @action = "create" > > > render :update do |page| > > > page.replace_html("user_form_message", "") > > > page.replace_html("user_form", :partial => "user_form", :locals => > { > > > :user => @user, :permissions => @permissions }) > > > end > > > end > > > > > > def edit > > > @user = User.find(@params[:id]) > > > @permissions = Permission.find(:all) > > > @action = "update" > > > render :update do |page| > > > page.replace_html("user_form_message", "") > > > page.replace_html ("user_form", :partial => "user_form", :locals > => { > > > :user => @user, :permissions => @permissions }) > > > end > > > end > > > end > > > > > > and the user_form partial: > > > > > > <%= form_remote_tag :url => { :controller => "/admin/users", :action => > > > @action } %> > > > <%= text_field :user, :login, :size => 10, :class => "field", :onfocus > => > > > "this.className=''field_selected'' ", :onblur => "this.className=''field ''" > > %> > > > <% permissions.each do |perm| -%> > > > <%= check_box_tag "user[permission_ids][]", perm.id, > > > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > > > <% end -%> > > > <%= text_field :user, :name, :size => 30, :class => "field", :onfocus > => > > > "this.className=''field_selected''", :onblur => " this.className=''field''" > %> > > > <%= submit_tag "Submit", :class => "button" -%> <input > > > type="button" class="button" value="Cancel" onclick=" > > > Element.update(''user_form'', '''')" /> > > > <%= hidden_field :user, :id %> > > > <%= end_form_tag %> > > > > > > > > > the problem i am having is that when the new action is rendered, the > form > > is > > > displayed empty as it should...but when the edit action is rendered, the > > > user fields are still blank. it appears that the form fields are > > expecting > > > to have @user accessible. if i remove the :locals from the render call > > (and > > > change the partial to use the instance vars as well), rails complains > that > > > @permissions is empty, so it appears that the instance vars are not even > > > available within the partial. is there a way to fix this behavior? > > > > > > Chris > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > -- > > Cody Fauser > > http://www.codyfauser.com > > _______________________________________________ > > > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Cody Fauser http://www.codyfauser.com
OK, done and done, now have revision 18. restarted WEBrick and voila, works as expected. Thanks again! Chris On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote:> > Chris, > > Maybe just nuke the javascript_generator_templates folder and > re-install the plugin using script/plugin install > javascript_generator_templates. > > The install must have done an svn export and not an svn checkout. > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > Cody, > > > > maybe i''m doing something wrong here, so forgive me. > > > > $> script/plugin update javascript_generator_templates > > Updating plugin: javascript_generator_templates > > svn: ''javascript_generator_templates'' is not a working copy > > > > i originally installed using the command > > > > script/plugin install javascript_generator_templates > > > > i guess i could do a remove and install again, i just want to make sure > i''m > > doing it the correct way. > > > > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > > > Chris, > > > > I thought so. I just added the patch from the trunk that fixed that. > > Try updating your plugin. You should get Rev 18. > > > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com > wrote: > > > plugin. > > > > > > > > > On 3/20/06, Cody Fauser <codyfauser@gmail.com> wrote: > > > > > > > Are you using the RJS plugin or Edge rails? > > > > > > On 3/20/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > > > > having a bit of an issue here with rjs and partials > > > > > > > > i have the following controller/action: > > > > > > > > class Admin::UsersController < ApplicationController > > > > def new > > > > @user = User.new > > > > @permissions = Permission.find (:all) > > > > @action = "create" > > > > render :update do |page| > > > > page.replace_html("user_form_message", "") > > > > page.replace_html("user_form", :partial => "user_form", > :locals => > > { > > > > :user => @user, :permissions => @permissions }) > > > > end > > > > end > > > > > > > > def edit > > > > @user = User.find(@params[:id]) > > > > @permissions = Permission.find(:all) > > > > @action = "update" > > > > render :update do |page| > > > > page.replace_html("user_form_message", "") > > > > page.replace_html ("user_form", :partial => "user_form", > :locals > > => { > > > > :user => @user, :permissions => @permissions }) > > > > end > > > > end > > > > end > > > > > > > > and the user_form partial: > > > > > > > > <%= form_remote_tag :url => { :controller => "/admin/users", :action > => > > > > @action } %> > > > > <%= text_field :user, :login, :size => 10, :class => "field", > :onfocus > > => > > > > "this.className=''field_selected'' ", :onblur => " > this.className=''field ''" > > > %> > > > > <% permissions.each do |perm| -%> > > > > <%= check_box_tag "user[permission_ids][]", perm.id, > > > > @user.permissions.include ?(perm) -%><%= perm.description -%><br/> > > > > <% end -%> > > > > <%= text_field :user, :name, :size => 30, :class => "field", > :onfocus > > => > > > > "this.className=''field_selected''", :onblur => " > this.className=''field''" > > %> > > > > <%= submit_tag "Submit", :class => "button" -%> <input > > > > type="button" class="button" value="Cancel" onclick=" > > > > Element.update(''user_form'', '''')" /> > > > > <%= hidden_field :user, :id %> > > > > <%= end_form_tag %> > > > > > > > > > > > > the problem i am having is that when the new action is rendered, the > > form > > > is > > > > displayed empty as it should...but when the edit action is rendered, > the > > > > user fields are still blank. it appears that the form fields are > > > expecting > > > > to have @user accessible. if i remove the :locals from the render > call > > > (and > > > > change the partial to use the instance vars as well), rails > complains > > that > > > > @permissions is empty, so it appears that the instance vars are not > even > > > > available within the partial. is there a way to fix this behavior? > > > > > > > > Chris > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > -- > > > Cody Fauser > > > http://www.codyfauser.com > > > _______________________________________________ > > > > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > -- > > Cody Fauser > > http://www.codyfauser.com > > _______________________________________________ > > > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > Cody Fauser > http://www.codyfauser.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/87e2120f/attachment-0001.html