Ruby on Rails Tuesday, April 7, 2015

Thanks for that Dave! Sometimes we over complicate stuff when learning :)

I just need to look into creating a form that will allow me to select a date for the timesheet, and then loop through all employees on the database to give me a option to create a timesheet for each employee using that specific date, all in one form.
The form will also allow me to enter the hours worked for each employee. When I submit the form, it should create a timesheet for each employee with their worked hours for that specific date.

a little help with the form and new/create methods would be a great help!

Thanks again...

On Tuesday, April 7, 2015 at 1:45:16 PM UTC+1, Dave Aronson wrote:
On Tue, Apr 7, 2015 at 8:41 AM, Bruno Walraven
<brunow...@gmail.com> wrote (rearranged to proper order):

> On Tuesday, April 7, 2015 at 1:36:55 PM UTC+1, Dave Aronson wrote:
>>
>> On Tue, Apr 7, 2015 at 5:41 AM, Bruno Walraven <brunow...@gmail.com>
>> wrote:
>>
>> > I have a Employee model, a Timesheet model and a Payment model.
>> > The Employee has many Timesheets and a Timesheet has many Employees.
>>
>> Are you sure you don't mean a Timesheet has *one* Employee?

> Do you mean by having a Timesheet that has a employee id, the date and the
> hours worked?

Yes, that's how timesheets usually work in the real world.  You may be
trying to do something different in your app, if you think it will
make the program better.  I'm just trying to clarify....

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/15b7a858-725f-423d-8e8c-f9f7a2ced00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment