Re: Button to trigger mailer?

Rodrigo Dominguez
2009-07-17T04:57:24Z

sinker wrote:
> My god, I think I was massively inarticulate in that previous post.
> Apologies.
>
> 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.
>
> Thanks so much,
>
> Dan

You can use

<%= link_to_remote ''send scheduling
e-mail'', {:action =>
''scheduled'', :id => story} %>

and then in the controller you can update the div of the current page
with a ok message or a error message

be sure to use the :href attribute and make a view answer for that
action in order to support js disabled
--
Posted via http://www.ruby-forum.com/.