Somewhere between 0.13.1 and the current SVN version the :overwrite_params option to url_for (and related methods) went missing. I can''t tell whether this was deliberate or by mistake, and I have no idea how to get the same functionality in some other way either. Michael -- Michael Schuerig Life is what happens mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org While you''re making plans http://www.schuerig.de/michael/ --Kevin Gilbert, A Long Day''s Life
On Wednesday 07 September 2005 01:31, Michael Schuerig wrote:> Somewhere between 0.13.1 and the current SVN version > the :overwrite_params option to url_for (and related methods) went > missing. I can''t tell whether this was deliberate or by mistake, and > I have no idea how to get the same functionality in some other way > either.This is the changeset http://dev.rubyonrails.org/changeset/1857 Still, I can''t make sense of why :overwrite_params was removed. AFAICT, this option has not been mentioned in the Rails docs, but it is in Agile Web Dev with Rails. Michael -- Michael Schuerig Those people who smile a lot mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Watch the eyes http://www.schuerig.de/michael/ --Ani DiFranco, Outta Me, Onto You
Here is a recent ticket about it as well : http://dev.rubyonrails.com/ticket/1909 On 9/7/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> > > On Wednesday 07 September 2005 01:31, Michael Schuerig wrote: > > Somewhere between 0.13.1 and the current SVN version > > the :overwrite_params option to url_for (and related methods) went > > missing. I can''t tell whether this was deliberate or by mistake, and > > I have no idea how to get the same functionality in some other way > > either. > > This is the changeset > > http://dev.rubyonrails.org/changeset/1857 > > Still, I can''t make sense of why :overwrite_params was removed. AFAICT, > this option has not been mentioned in the Rails docs, but it is in > Agile Web Dev with Rails. > > Michael > > -- > Michael Schuerig Those people who smile a lot > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Watch the eyes > http://www.schuerig.de/michael/ --Ani DiFranco, Outta Me, Onto You > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I''ve got problem with :overwrite_params in the last release too, though I''ve located the problem at this line in routing.rb: Routing.treat_hash(options, keys_to_delete) This line makes that :overwrite_params => { :newopt => "value", :oldopt =>"updated"} is present in the url as newoptvalueoldoptupdated , and not as newopt=value&oldopt=updated. Looking at the code of treat_hash, it seems logical: def treat_hash(hash, keys_to_delete = []) k = v = nil hash.each do |k, v| if v then hash[k] = (v.respond_to? :to_param) ? v.to_param.to_s : v.to_s else hash.delete k keys_to_delete << k end end hash end I''ll test later with an svn checkout, but I saw treat_hash is still present. Raph On 9/7/05, Joshua Sierles <jsierles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Here is a recent ticket about it as well : > > http://dev.rubyonrails.com/ticket/1909 > > > On 9/7/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote: > > > > On Wednesday 07 September 2005 01:31, Michael Schuerig wrote: > > > Somewhere between 0.13.1 and the current SVN version > > > the :overwrite_params option to url_for (and related methods) went > > > missing. I can''t tell whether this was deliberate or by mistake, and > > > I have no idea how to get the same functionality in some other way > > > either. > > > > This is the changeset > > > > http://dev.rubyonrails.org/changeset/1857 > > > > Still, I can''t make sense of why :overwrite_params was removed. AFAICT, > > this option has not been mentioned in the Rails docs, but it is in > > Agile Web Dev with Rails. > > > > Michael > > > > -- > > Michael Schuerig Those people who > smile a lot > > mailto: michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Watch the eyes > > http://www.schuerig.de/michael/ --Ani DiFranco, Outta Me, Onto You > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
On Saturday 10 September 2005 15:22, Raphael Bauduin wrote:> I''ve got problem with :overwrite_params in the last release too, > though I''ve located the problem at this line in routing.rb:I don''t know how well it works in 0.13.1, but in recent SVN revisions it does work. Be careful checking out just now, though, by my lights, routing with WEBrick is broken at the moment (http://dev.rubyonrails.org/ticket/2165). Michael -- Michael Schuerig Those who call the shots mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Are never in the line of fire http://www.schuerig.de/michael/ --Ani DiFranco, Not So Soft