I'm new to ruby on rails and I need some help with amending a view i
created using partials. I need to create a booking form that allows me
to enter a business name, address and category and i created three
different views, tables etc using scaffolding (I did this as I needed
separate tables for normalisation).
The problem is that I now have the form I need to capture the relevent
information but I cannot save the information in one go as there are
three different create buttons. I deleted the code for the buttons but
that does not help as I can only save one part of the form instead of
saving all the information on the form. I have added the relevant
relationships between the tables but I am not sure how I can save all
the information on the form. Apologises if I have not explained this
well, I wish there was a way to show you a screenshot of what i mean.
Thanks for replying, I'd like to post an image but Iseem to be having
a few issues posting the link on here, I used image shack to upload
the image of the form but I cannot post the direct link or embedded
link, i keep getting an error message saying "We were unable to post
your message". Not sure what to do.
First, edit all the form partials and remove the form tags so that only
the fields are left.
I dont know what the relationship between the models are. Is it business
has one category and has one address? If so, the form would look
something like:
The relationship between the business, address and catogories is: a
business can only have one address but an address can have one or many
businesses, a business can have one or many categories and a category
can have one or many businesses.
I have already created the relationships and another table to
decompose the relationship between category and business. I'm actually
working on a final year project on how to adapt SCRUM to a one man
team, I have to use ruby on rails as my tutor says it works well with
this methodology, I don't have much technical aptitude with
programming but I'm pretty good with the SCRUM side of things. The
reason the model design may seem weird is that I was told to use
scaffolding and partials to create this part of the app.
I've got rid of the multiple create buttons that were present when I
created the form and I am only left with one create button.
How do make the create button save all the data on the form? Also what
validation method do I use to check that the details I want to save
are not already present in the database?