Hi all, In one of my create action in the controller, I am catching a error and trying to show errors on the same page. It was all good when I called render action => ''new''. However, I also wanted to append a query string for consistence purposes. How do I do that with render? For now, I can only call redirect_to and put the error in the flash variable which doesn''t seems to be as clean of a solution. Thanks in advance. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jun 1, 1:58 am, Herman <herman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > In one of my create action in the controller, I am catching a error > and trying to show errors on the same page. It was all good when I > called render action => ''new''. However, I also wanted to append a > query string for consistence purposes. How do I do that with render? > For now, I can only call redirect_to and put the error in the flash > variable which doesn''t seems to be as clean of a solution. >render just renders a template - you can''t change the query string (without redirecting) because the browser shows the url it accessed. You could change your form to a get form if you wanted to (although that would put all the form parameters in the url) Fred> Thanks in advance.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Try using the :locals hash that can be passed with render to the view, works fine for me. On Jun 1, 11:22 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 1, 1:58 am, Herman <herman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > > In one of my create action in the controller, I am catching a error > > and trying to show errors on the same page. It was all good when I > > called render action => ''new''. However, I also wanted to append a > > query string for consistence purposes. How do I do that with render? > > For now, I can only call redirect_to and put the error in the flash > > variable which doesn''t seems to be as clean of a solution. > > render just renders a template - you can''t change the query string > (without redirecting) because the browser shows the url it accessed. > You could change your form to a get form if you wanted to (although > that would put all the form parameters in the url) > > Fred> Thanks in advance.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.