Updated specific locations to be searchable, take a look at Las Vegas as an example.

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
Need a little help wrapping my head around something.
Post Body

Hey /r/rails!

Using Rails 3.2.13 and I've hit a major snag, hoping you guys could help.

Alright, so I need to make a model called LabTickets which has_many Tasks. Tasks has_many Equipment and belongs to User.

I need to be able to create the LabTicket independent of the Tasks- there can be LabTickets without tasks.

Ideally, I want the use case to be:

Create LabTask --> Add Task --> Select Equipment for Task --> Assign User to Task --> Save Task --> Automatically create a LabTicketTask association --> Automatically create TaskEquipment associations for each piece of Equipment associated with the Task --> Repeat as needed

Issue #1: When I add a Task, it should display a list of Equipment in the place the LabTicket was created. I need to be able to pick and choose from this list, then when the Task is saved, create a TaskEquipment record for each piece of Equipment selected, but I don't really know how to go about this.

I suspect that JavaScript might be useful for handling the cherry-picking of equipment and creation of TaskEquipment associations as they happen, but I am completely at a loss as to how JavaScript works on an object level (i.e. interacting with the database).

I also think that accepts_nested_attributes might work for assigning equipment, but as I'm not actually creating equipment when I add it to a Task (unlike a survey, where the questions are created when an answer is created, etc.), I'm not sure how.

Anyway, I really hope one of y'all can help me out.

Best,

-/u/DaveahamLincoln

Author
Account Strength
100%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
10,478
Link Karma
8,040
Comment Karma
2,438
Profile updated: 4 days ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
10 years ago