Correct me if I'm wrong, but what you are really looking for is just
an address lookup step in the middle of the model creation process.
Why don't you start with the Customer#new that shows the zip code
field only at first. The user enters the code and you send an Ajax
call to the CustomersController#address_lookup or
AddressesController#show (finding by given zip as opposed to usual ID)
and if you get the response, you populate the address selector and
show the rest of the form, including the "Submit" button.

My point is that you don't have a huge wizard-like multi-step process.
All you need is a simple lookup, so why don't just do that?

- Aleksey

On Jan 22, 2:34 am, Andrew Edwards <[email protected]>
wrote:
> Thanks Jamey, glad I'm not far off.
>
> With regard to action names, I can see what you mean but I think
> you've missed a step out of my process. I was thinking:
>
> index: renders textbox to enter zip code and submits to 'new'
> new: looks up zipcode and renders select box of addresses at zipcode,
> user makes selection and form submits to 'create'
> create: redirect to the customer controller's 'new' action, passing
> unqiue reference to selected address
>
> I think we're more or less saying the same thing though.
>
> Andrew.
>
> On Jan 21, 3:09 pm, Jamey Cribbs <[email protected]> wrote:
>
>
>
> > On Thu, Jan 21, 2010 at 9:33 AM, Andrew Edwards
>
> > Also, I would probably rename the NewCustomerAddress resource to
> > something like CustomerAddressZip or ZipCodeSearch.
>
> > Other than that I think you are on the right track.  The main point is
> > to not try to shoe-horn in all your actions into one controller.  Keep
> > each controller to the basic seven.  When you find yourself needing
> > more actions, it is time to create a new controller.
>
> > Jamey

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to