Skip to content

Notification when overriding a default routeΒ #625

@jjf21

Description

@jjf21

Expected behavior

When overriding a route, I can't edit the success notification:

Actual behavior

Here is my code:

# lib/forest_liana/controllers/organizations_controller.rb
if ForestLiana::UserSpace.const_defined?("OrganizationController")
  ForestLiana::UserSpace::OrganizationController.class_eval do

    def destroy
      organization_id = params[:id]
      Organizations::DestroyWorker.perform_async(organization_id)
      render status: 200, json: { success: "The organization #{organization_id} will be deleted soon!" }
    end

end

I always get "Organization deleted!" as notification

I've tried several way to render a success messages but non of them worked
render status: 200, plain: success_message
render status: 201, html: success_message

In smart actions it says : render json: { success: success_message }

Thanks for you help !

forest_liana (7.6.7)

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