Newbie ActionMailer question:

I've created a mailer, and am pretty sure I've set its parameters
correctly.

I've created a view for that mailer, and am also pretty sure I've set
it up correctly.

I can call the mailer and it works right when I put the deliver_ in
another controller or simply on a page.

So all that's great.

BUT, what I really want to do is have a simple button that, when hit,
will trigger that mailer, passing an :id to it as well.

I can't figure out how to code the button though. Any ideas?

here's what's in the mode:

def scheduled(story)
 recipients     story.author.email
 subject                "Your story has been scheduled"
 from           "[email protected]"
 sent_on                Time.now
 body           :story => story
end

here's the template (excerpt):
Hi <%= @story.author.name %>
....

here's the deliver_ action:  Emailer.deliver_scheduled(@story)

Again, all this stuff works but I can't seem to figure out how to
simply smack a button and send an e-mail. I'm sure it's something I'm
just overlooking.

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to