https://avo.cool logo
What's the recommended way to flash
# general
m
What's the recommended way to flash error/success notices in an Avo::ToolsController method?
l
Hi @melodic-beard-26329 here is a snippet with all the possible flash types, this would make a cool quick guide, I'll add this to our guide ideas discussion
Copy code
ruby
class Avo::ToolsController < Avo::ApplicationController
  def custom_tool
    @page_title = "Custom tool"

    # Error
    flash[:error] = "This is an error"
    flash[:alert] = "This is an alert"

    # Success
    flash[:success] = "This is a success"

    # Info
    flash[:info] = "This is an info"
    flash[:notice] = "This is a notice"

    # Warning
    flash[:warning] = "This is a warning"

    # Something else
    flash[:something_else] = "This is a primary"
  end
end
Added it to the guides list 😉 https://github.com/avo-hq/docs.avohq.io/discussions/373
m
Awesome, thank you