- Extended by:
- Included in:
- Admin::ApplicationController, AmendmentsController, Debates::DebatesController, Devise::OmniauthRegistrationsController, EditorImagesController, FollowsController, GroupEmailConfirmationsController, GroupInvitesController, GroupsController, Initiatives::InitiativeSignaturesController, Initiatives::InitiativeVotesController, Initiatives::InitiativesController, Meetings::MeetingClosesController, NewslettersOptInController, Proposals::CollaborativeDraftsController, Proposals::ProposalsController, ReportUsersController, ReportsController, System::ApplicationController, UploadValidationsController
- Defined in:
A factory to build forms. This is done to add a context when possible, so that forms can act based on data that varies between requests. This is mostly done so that i18n form fields can be properly validated with the ‘current_organization` available locales, instead of doing so against all the available locales in the platform. The `current_organization` varies between requests, so the form need some way to access this data.
# in a controller, mostly in a `create` action: form(MyFormClass).form_params(params) # in a controller, mostly in a `new` action: form(MyFormClass).instance # in a controller, mostly in an `edit` action: form(MyFormClass).form_model(@my_resource)