Hi Stefan,

I think there are a couple of ways of doing this.

The official way would be to use translations (config/locales/**.yml).
You can use "config.hobo.show_translation_keys = true" in
config/application.rb to see the right key.

The alternative would be to add a "response" in the block. When Hobo
sees that there is no response, the automatic response system comes into
place. But it you put a redirect like this, it should never be called:

      def do_add_to_basket
        do_transition_action :add_to_basket do
          flash[:success] = "Product was added successfully."
          flash[:notice] = "Product was added successfully."
          redirect_to @product
        end
      end

Warm regards,
Ignacio

El 15/01/14 18:47, Stefan Haslinger escribió:
> Hi folks!
> 
> In a lifecycle I declare a transition
> 
>         transition :add_to_basket, {:active => :active}, :available_to
>     => :all do
>           product = Product.where(id: self).first
>           acting_user.basket.add_product(product)
>         end
> 
> 
> and I customize the flash in the controller
> 
>       def do_add_to_basket
>         do_transition_action :add_to_basket do
>           flash[:success] = "Product was added successfully."
>           flash[:notice] = "Product was added successfully."
> 
>         end
>       end
> 
> 
> The success comes up, the notice not, it's overridden by
> hobo/hobo/lib/hobo/controller/model.rb line 672
> 
>     flash_notice
>     (ht(:"#{@this.class.to_s.underscore}.messages.update.success",
>     :default=>["Changes to the #{@this.class.model_name.human} were
>     saved"]))
> 
> 
> I placed debugger in both location, and yes, I am to early in my controller.
> Any idea how to save my notice without patching hobo? (or changing the
> flash tag in DRYML on that page?)
> 
> Greetings from icy Vienna,
> Stefan
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to