Class: Decidim::Meetings::Admin::MeetingRegistrationsForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Meetings::Admin::MeetingRegistrationsForm
- Includes:
- TranslatableAttributes
- Defined in:
- app/forms/decidim/meetings/admin/meeting_registrations_form.rb
Overview
This class holds a Form to update meeting registrations from Decidim's admin panel.
Instance Method Summary collapse
-
#id ⇒ Object
We need this method to ensure the form object will always have an ID, and thus its
to_parammethod will always return a significant value.
Instance Method Details
#id ⇒ Object
We need this method to ensure the form object will always have an ID,
and thus its to_param method will always return a significant value.
If we remove this method, get an error on the update action and try
to resubmit the form, the form will not hold an ID, so the to_param
method will return an empty string and Rails will treat this as a
create action, thus raising an error since this action is not defined
for the controller we are using.
TL;DR: if you remove this method, we will get errors, so do not.
47 48 49 50 51 |
# File 'app/forms/decidim/meetings/admin/meeting_registrations_form.rb', line 47 def id return super if super.present? meeting.id end |