Should microform also have an "install" generator that adds an ApplicationForm class to your project?
Or, taking a step back, how can some of the generic functionality like the respond_to? and other delegation method. This could either be a parent class, or a mix-in module, or simply repeated in each form class.
The next question is, if functionality is shared in either of those way, does that mean that the instance variable needs to get more generic:
def initialize project
@project = project
end
# vs
def initialize record
@record = record
end
Or, is there some way that the instance variable is configured. This could be too clever:
class ProjectForm
include Micrform::Form[:project]
end
Or, the instance variable could be inferred from the form name, e.g. ProjectForm assumes there will be a @project instance variable assigned in the initializer.
Do these "solutions" jump trough too many hoops to just avoid renaming the attribute to the more generic record?
Should microform also have an "install" generator that adds an ApplicationForm class to your project?
Or, taking a step back, how can some of the generic functionality like the
respond_to?and other delegation method. This could either be a parent class, or a mix-in module, or simply repeated in each form class.The next question is, if functionality is shared in either of those way, does that mean that the instance variable needs to get more generic:
Or, is there some way that the instance variable is configured. This could be too clever:
Or, the instance variable could be inferred from the form name, e.g.
ProjectFormassumes there will be a@projectinstance variable assigned in the initializer.Do these "solutions" jump trough too many hoops to just avoid renaming the attribute to the more generic
record?