Re: Button to trigger mailer?

sinker
2009-07-17T12:34:30Z

Thanks for the responses!

link_to_remote doesn''t seem to do anything. Looking at the terminal
window when I hit it, it just reloads the page. I change it back to
link_to and the terminal does all the e-mail song & dance. Am I
missing a step with link_to_remote?

And render :nothing => true gets rid of the page not found error, but
instead simply displays a blank page once the e-mail has been sent.

Hrm...

On Jul 16, 11:57 pm, Rodrigo Dominguez <rails-mailing-l...@andreas-
s.net> wrote:
> 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 viahttp://www.ruby-forum.com/.