Re: Button to trigger mailer?

bill walton
2009-07-17T04:24:22Z

Hi Dan,

On Thu, 2009-07-16 at 19:48 -0700, sinker wrote:
> My god, I think I was massively inarticulate in that previous post.
> Apologies.

Happens to us all ;-)

> Here''s the thing:
>
> I can successfully send an e-mail through all of the above by simply
> calling it like this:
>
> <%= link_to ''send scheduling
e-mail'', {:action =>
> ''scheduled'', :id => story} %>
>
> BUT, after it sends an e-mail, it wants to go to a view called
> scheduled in the controller it''s currently in. Which
doesn''t exist.
>
> I don''t want it to go anywhere. Just send the e-mail, and maybe
flash
> that it sent.
>
> THAT''S my question.

Not sure I completely understand, but try adding:

render :nothing => true

as the last line in your controller method.  I think you can add the
flash[:message]=''blah blah'' above that and that it will
display, but
don''t recall having used the two together before myself.  Sorry I
can''t
be of more definitive assistance.

HTH,
Bill

> Thanks so much,
>
> Dan
> >