On 17 March 2010 15:41, Clay H. <ccheaton@gmail.com> wrote:
> How do I either:
> 1) Detect which action/view/template sent the user to the create
> action, so that I can conditionally return them to the proper action
> using render?
>
> or
>
> 2) Use redirect_to(:back) and still show the validation errors?
>
The RESTful way is to have a "dispense_stock" controller - which has
its own methods.
The cheaty (smelly) way is to put a hidden field in the form or an
extra querystring parameter with with the value "new" or "dispense",
and check the params hash for the value.
--
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@googlegroups.com.
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.
No comments:
Post a Comment