Class: Decidim::Meetings::Admin::MeetingRegistrationsForm

Inherits:
Form
  • Object
show all
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

Instance Method Details

#idObject

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 onn 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’re using.

TL;DR: if you remove this method, we’ll get errors, so don’t.



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