Forum: Ruby on Rails make accessible object..

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jay P. (Guest)
on 2008-10-20 11:51
Hi, I've created a form and when I click "Place Order" button, I'm taken
to the checkout details page with all the details about the customer and
the bookings and then there is a "Confirm" button, on clicking which all
the details will be saved in the database tables. But a silly problem
(ended up being huge for me), heres what I've done:

VIEW:
<%form_for :customer, :url => {:action => :checkout_details} do |form|%>
 .............
 <%=submit_tag "Place Order"%>
<%end>

CONTROLLER:
def checkout_details
 @customer = Customer.new(params[:customer])
end

Until now I could get the object of the Customer and hence all the
inputs from the user but this checkout_details.rhtml doesn't save
anything it just displays all the customer details and booking details
and a "Confirm" button on clicking which "save_details" action will be
called which saves all the details. So, how can I pass this @customer
object to this save_details action? Sorry, if it is silly, but big
enough for me to get stuck.
Thanks..
Mukund (Guest)
on 2008-10-20 13:26
(Received via mailing list)
http://api.rubyonrails.org/classes/ActionControlle...

I do recommend you buy a book on Rails.  It is worth the
investment.

On Oct 20, 12:51 pm, Jay P. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.