Hi folks, I have following in my view : ================== <div class="foo"> <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id ] }, { :prompt => ''Select a theme'' } %> </div> <%= observe_field( :theme_id, :update => :my_style, :url => { :action => :themelookup, :id => @space,}, :with => ''theme_id'') %> <div class="userfoo"> <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> </div> ======================================== Basically I''m updating the text area based on selection made from selection box. This works well. But in firefox, if I edit the value in textbox and try to make a different selection from the selection box, it doesnt update. This works well in IE !? Any pointers ? Thanks, Pratik -- rm -rf / 2>/dev/null - http://null.in
Anyone :-s ? On 6/22/06, Pratik <pratiknaik@gmail.com> wrote:> Hi folks, > > I have following in my view : > ==================> > <div class="foo"> > <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id > ] }, { :prompt => ''Select a theme'' } %> > </div> > > <%= observe_field( > :theme_id, > :update => :my_style, > :url => { :action => :themelookup, :id => @space,}, > :with => ''theme_id'') > %> > > <div class="userfoo"> > <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> > </div> > ========================================> > Basically I''m updating the text area based on selection made from > selection box. This works well. But in firefox, if I edit the value in > textbox and try to make a different selection from the selection box, > it doesnt update. This works well in IE !? Any pointers ? > > Thanks, > Pratik > -- > rm -rf / 2>/dev/null - http://null.in >-- rm -rf / 2>/dev/null - http://null.in
Pratik wrote:> <div class="foo"> > <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id > ] }, { :prompt => ''Select a theme'' } %> > </div> > > <%= observe_field( > :theme_id, > :update => :my_style, > :url => { :action => :themelookup, :id => @space,}, > :with => ''theme_id'') > %> > > <div class="userfoo"> > <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> > </div> > ========================================> > Basically I''m updating the text area based on selection made from > selection box. This works well. But in firefox, if I edit the value in > textbox and try to make a different selection from the selection box, > it doesnt update. This works well in IE !? Any pointers ?Two things to look at with your observe field call: 1. You should be updating userfoo rather than my_style 2. You don''t need to use the :with option -- We develop, watch us RoR, in numbers too big to ignore.
That''s how I got that working. But still dont understand why I cannot update "my_style". It works well in IE. Also, when I update "userfoo", I need to write html code in my controller. What are the common ways to keep my controller clean to avoid this kind of cases ? Thanks for the reply Mark. -Pratik On 6/22/06, Mark Reginald James <mrj@bigpond.net.au> wrote:> Pratik wrote: > > > <div class="foo"> > > <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id > > ] }, { :prompt => ''Select a theme'' } %> > > </div> > > > > <%= observe_field( > > :theme_id, > > :update => :my_style, > > :url => { :action => :themelookup, :id => @space,}, > > :with => ''theme_id'') > > %> > > > > <div class="userfoo"> > > <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> > > </div> > > ========================================> > > > Basically I''m updating the text area based on selection made from > > selection box. This works well. But in firefox, if I edit the value in > > textbox and try to make a different selection from the selection box, > > it doesnt update. This works well in IE !? Any pointers ? > > Two things to look at with your observe field call: > > 1. You should be updating userfoo rather than my_style > 2. You don''t need to use the :with option > > -- > We develop, watch us RoR, in numbers too big to ignore. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- rm -rf / 2>/dev/null - http://null.in
Look into RJS templates. They will let you write these calls without regenerating any HTML in the controller actions. http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates Jason Pratik wrote:> That''s how I got that working. But still dont understand why I cannot > update "my_style". It works well in IE. > > Also, when I update "userfoo", I need to write html code in my > controller. What are the common ways to keep my controller clean to > avoid this kind of cases ? > > Thanks for the reply Mark. > > -Pratik > > On 6/22/06, Mark Reginald James <mrj@bigpond.net.au> wrote: >> Pratik wrote: >> >> > <div class="foo"> >> > <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id >> > ] }, { :prompt => ''Select a theme'' } %> >> > </div> >> > >> > <%= observe_field( >> > :theme_id, >> > :update => :my_style, >> > :url => { :action => :themelookup, :id => @space,}, >> > :with => ''theme_id'') >> > %> >> > >> > <div class="userfoo"> >> > <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> >> > </div> >> > ========================================>> > >> > Basically I''m updating the text area based on selection made from >> > selection box. This works well. But in firefox, if I edit the value in >> > textbox and try to make a different selection from the selection box, >> > it doesnt update. This works well in IE !? Any pointers ? >> >> Two things to look at with your observe field call: >> >> 1. You should be updating userfoo rather than my_style >> 2. You don''t need to use the :with option >> >> -- >> We develop, watch us RoR, in numbers too big to ignore. >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > >
Just ordered Cody''s book on RJS :) On 6/22/06, Jason Roelofs <jameskilton@gmail.com> wrote:> Look into RJS templates. They will let you write these calls without > regenerating any HTML in the controller actions. > > http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates > > Jason > > Pratik wrote: > > That''s how I got that working. But still dont understand why I cannot > > update "my_style". It works well in IE. > > > > Also, when I update "userfoo", I need to write html code in my > > controller. What are the common ways to keep my controller clean to > > avoid this kind of cases ? > > > > Thanks for the reply Mark. > > > > -Pratik > > > > On 6/22/06, Mark Reginald James <mrj@bigpond.net.au> wrote: > >> Pratik wrote: > >> > >> > <div class="foo"> > >> > <%= select ''theme'', "id", Theme.find_all.collect {|t| [ t.name, t.id > >> > ] }, { :prompt => ''Select a theme'' } %> > >> > </div> > >> > > >> > <%= observe_field( > >> > :theme_id, > >> > :update => :my_style, > >> > :url => { :action => :themelookup, :id => @space,}, > >> > :with => ''theme_id'') > >> > %> > >> > > >> > <div class="userfoo"> > >> > <%= text_area ''my'', ''style'', :cols => ''65'', :rows=>''10'' %> > >> > </div> > >> > ========================================> >> > > >> > Basically I''m updating the text area based on selection made from > >> > selection box. This works well. But in firefox, if I edit the value in > >> > textbox and try to make a different selection from the selection box, > >> > it doesnt update. This works well in IE !? Any pointers ? > >> > >> Two things to look at with your observe field call: > >> > >> 1. You should be updating userfoo rather than my_style > >> 2. You don''t need to use the :with option > >> > >> -- > >> We develop, watch us RoR, in numbers too big to ignore. > >> > >> _______________________________________________ > >> 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 >-- rm -rf / 2>/dev/null - http://null.in