-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I agree with Bryan about moving external logic to a class in /lib,
/services or something similar. You can also tune the transitions in
your controller if you wish:

  def do_mark_as_read
    notice = Notice.find(params[:id])
    if notice.ready?
      do_transition_action :mark_as_read
    else
      flash[:error] = "Please do something first"
      redirect_to(:action => 'show')
    end
  end

Regards,
Ignacio

El 18/09/12 22:40, brettnem escribió:
> Hello All,
> 
> I have a working lifecycle, but the logic for it is getting quite 
> complicated. Part of the lifecycle requires accessing other
> system's APIs and has browser redirects in them. This logic feels
> like controller logic. Am I doing something wrong? Is it possible
> to call controller methods from a lifecycle?
> 
> Thanks, Brett
> 
> -- You received this message because you are subscribed to the
> Google Groups "Hobo Users" group. To view this discussion on the
> web visit 
> https://groups.google.com/d/msg/hobousers/-/9DZac9RPNxgJ. To post
> to this group, send email to [email protected]. To
> unsubscribe from this group, send email to 
> [email protected]. For more options, visit
> this group at http://groups.google.com/group/hobousers?hl=en.

- -- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBbGhEACgkQBPlUJ6RHaOSMoQCgpLQbZ9PduUlHcw9Pzj9yT+Yg
5IMAniqNJWVj3lFhyUXXiM/VT6ZNecJJ
=2jET
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to