apache / apache/grails-core

No view support apparently generated for adding an entity to a 'hasMany' association

Open
#14,290 0 comments 1 reaction 0 assignees View on GitHub
relates-to: scaffolding
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

With a simple Book / Author example it seems that the scaffolded 'create new author' view is not rendering a provision for adding a 'book' (created on the spot, or already existing in the system) to the 'hasMany books' association. I'm using Grails 3.1.2 with scaffolding plugin 3.2.1 . Here is my use case:

// Model
class Book {
String title
}

class Author {
String name
static hasMany = [books: Book]
}

// Controllers
class BookController {
static scaffold = Book
}

class AuthorController {
static scaffold = Author
}

I certainly might be missing something but with such a straightforward example I'm wondering if this might be a bug with either the scaffolding plugin, grails, or the interaction between the two...

Contributor guide

Open the contributing guide

Research direction

Reproduce the Book and Author example with Grails 3.1.2 and scaffolding plugin 3.2.1, then inspect the generated Author create view and its handling of the hasMany books association. Compare the behavior for creating a new Book and selecting an existing one; done means the expected association controls are rendered or the missing support is clearly confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.