Calling render with query string

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.

On Jun 1, 1:58am, Herman [email protected] 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

Try using the :locals hash that can be passed with render to the view,
works fine for me.

On Jun 1, 11:22am, Frederick C. [email protected]