Hi Guys,
I’m building an application that allows users to first fill in details
of a recent trip to the gym, once they click submit these details are
saved to a database table and redirects to a form that lets them input
the exercises they carried out and saves them in a second table.
I need to know how to pass the id of the update to the second form, my
controller for the update currently looks like this:
def update
@update = Update.find(params[:id])
if @update.update_attributes(params[:update])
flash[:notice] = ‘Update was successfully updated.’
redirect_to :action => ‘show’, :id => @update
else
render :action => ‘edit’
end
end
the redirect works fine, I’m pretty certain the :id=> is completely
wrong but I’m not sure how to go about this…
cheers,
Lee.