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

Inherits:
Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
decidim-meetings/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

Methods included from TranslatableAttributes

#default_locale?

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.


44
45
46
47
48
# File 'decidim-meetings/app/forms/decidim/meetings/admin/meeting_registrations_form.rb', line 44

def id
  return super if super.present?

  meeting.id
end