Sha256: 4bf8065cb7af0da2fe1e362be57f1f357221bc58c82ac847110650c7131cb75a

Contents?: true

Size: 700 Bytes

Versions: 11

Compression:

Stored size: 700 Bytes

Contents

class Tramway::Event::ParticipantsController < Tramway::Event::ApplicationController
  def create
    event = ::Tramway::Event::Event.find params[:tramway_event_participant][:event_id]
    class_name = "ParticipantExtendedForm#{request.uuid.gsub('-', '')}"
    form_class = ::Tramway::Core::ExtendableForm.new(class_name, *(event.participant_form_fields.inputs_list.map(&:title)).map(&:to_sym))
    @participant_form = form_class.new ::Tramway::Event::Participant.new event_id: event.id
    if @participant_form.submit params[:tramway_event_participant].except :event_id
      redirect_to event_path event, flash: :success
    else
      redirect_to event_path event, flash: :error
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tramway-event-1.2.6 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2.5 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2.4 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2.3 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2.2 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2.1 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.2 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.1 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.0.1 app/controllers/tramway/event/participants_controller.rb
tramway-event-1.0 app/controllers/tramway/event/participants_controller.rb
tramway-event-0.7 app/controllers/tramway/event/participants_controller.rb