Skip to content

For example, we have something like this. We want to activate user after submit #64

@kalashnikovisme

Description

@kalashnikovisme

For example, we have something like this. We want to activate user after submit

class UserForm < Tramway::BaseForm
  def submit(params)
    super.tap do |result|
      object.activate if result == true
    end
  end
end

Maybe we should implement callbacks in Tramway Form to be able do something like this?

class UserForm < Tramway::BaseForm
  after_submit -> { object.activate }
  after_resist -> { object.deactivate }
end

I think it will allow to us do something this too

class Users::RejectForm < Tramway::BaseForm
  properties :reject_reason

  after_submit -> { user.reject }
end

What do you think?

Originally posted by @kalashnikovisme in #47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions