Ruby on Rails Flash Messages With Hotwire

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 20

  • @shrig018
    @shrig018 Год назад

    thank you, these hotwire videos have helped me a lot.

  • @GabrielSouza-iu3pd
    @GabrielSouza-iu3pd 2 года назад

    Thank you for all the content you bring about the use of hotwire, it has helped me a lot.

    • @mixandgo
      @mixandgo  2 года назад +1

      It's a pleasure :)

  • @alanr3id
    @alanr3id 2 года назад

    Another cracking video. 👏 keep them coming

  • @dencam
    @dencam 2 года назад

    Thank you, the video was useful!

    • @mixandgo
      @mixandgo  2 года назад

      Happy to hear that 👍🏻

  • @rdepaulabarbosa
    @rdepaulabarbosa 2 года назад

    thanks a lot for the content!

    • @mixandgo
      @mixandgo  2 года назад

      You're welcome :)

  • @bidangitau84
    @bidangitau84 2 года назад

    very helpfull....do u have a blog on more about rails models/controllers logic stuff

    • @mixandgo
      @mixandgo  2 года назад

      I do have a blog at mixandgo.com. But I'm not sure what you mean by models/controller logic.

  • @komrad4life
    @komrad4life 2 года назад

    Very nice

  • @phanta5m
    @phanta5m 2 года назад

    the flash is super usefull

  • @a79rtur
    @a79rtur 2 года назад

    flash keep is a cool tidbid

  • @prakashsanyasi5608
    @prakashsanyasi5608 2 года назад

    👍👍👍👍

  • @masoud-abedi
    @masoud-abedi 7 месяцев назад

    Thanks a lot for the content. I have a button on my form, and I want to run a render, but I need to send the output to a server. I'm trying to show a message, but I'm having trouble because of the render.
    Here's my code:
    def my_button
    mydata = render json: @project, include: [params[:include]]
    ...
    flash[:notice] = "#{t('project')} was successfully published with ID #{identifier}."
    respond_to do |format|
    format.html { redirect_to(@project) }
    format.rdf { render template: 'rdf/show' }
    format.json { render json: @project, include: [params[:include]] }
    end
    end
    Any ideas on how to fix this? Thanks!

  • @hidr0frbg
    @hidr0frbg 2 года назад

    You can use add_flash_types :foo and do redirect_to link, foo: "message".

    • @mixandgo
      @mixandgo  2 года назад

      Cool tip. Thanks for sharing.