Hi, Is it possible to render a partial template from within a mail template? I get the following error undefined method `controller_path'' for SupportMailer:Class Extracted source (around line #8): 5: 6: <%= @url %> 7: 8: <%= render_partial ''sig_admin'' %> Jeroen
On Nov 17, 2005, at 8:38 AM, Jeroen Houben wrote:> Hi, > > Is it possible to render a partial template from within a mail > template? > I get the following error > > undefined method `controller_path'' for SupportMailer:Class > > Extracted source (around line #8): > > 5: > 6: <%= @url %> > 7: > 8: <%= render_partial ''sig_admin'' %> >Could you file this as a bug on dev.rubyonrails.com? It looks like I need to do a bit more work to make ActionMailer quack like an ActionController... - Jamis
On 11/17/05, Jamis Buck <jamis-uHoyYlH2B+GakBO8gow8eQ@public.gmane.org> wrote:> On Nov 17, 2005, at 8:38 AM, Jeroen Houben wrote: > > > Hi, > > > > Is it possible to render a partial template from within a mail > > template? > > I get the following error > > > > undefined method `controller_path'' for SupportMailer:Class > > > > Extracted source (around line #8): > > > > 5: > > 6: <%= @url %> > > 7: > > 8: <%= render_partial ''sig_admin'' %> > > > > Could you file this as a bug on dev.rubyonrails.com? It looks like I > need to do a bit more work to make ActionMailer quack like an > ActionController...Anyone know the status of this? I''m running into the same problem using Rails 1.0.
On 12/30/05, Joe Van Dyk <joevandyk@gmail.com> wrote:> On 11/17/05, Jamis Buck <jamis@37signals.com> wrote: > > On Nov 17, 2005, at 8:38 AM, Jeroen Houben wrote: > > > > > Hi, > > > > > > Is it possible to render a partial template from within a mail > > > template? > > > I get the following error > > > > > > undefined method `controller_path'' for SupportMailer:Class > > > > > > Extracted source (around line #8): > > > > > > 5: > > > 6: <%= @url %> > > > 7: > > > 8: <%= render_partial ''sig_admin'' %> > > > > > > > Could you file this as a bug on dev.rubyonrails.com? It looks like I > > need to do a bit more work to make ActionMailer quack like an > > ActionController... > > Anyone know the status of this? I''m running into the same problem > using Rails 1.0.I tried to search dev.rubyonrails.org but couldn''t figure out how to search the bug list. I tried filtering, but clicking the ''plus'' filter button didn''t seem to do anything remotely useful.
Hi Joe, An unrelated question .. I am trying to use action mailer but I am having problems with the views .. Where exactly do the variables in the view come from .For example in your code you use @url. Is this an instance variable you created in your Mailer < ActionMailer::Base ? Thanks Vivek> > > 6: <%= @url %> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20051231/4559e5ba/attachment-0001.html
Benjamin Stiglitz
2005-Dec-31 06:00 UTC
[Rails] Re: ActionMailer view variables (was Re: render :partial in mail template)
> I am trying to use action mailer but I am having problems with the > views .. Where exactly do the variables in the view come from .For > example in your code you use @url. Is this an instance variable you > created in your Mailer < ActionMailer::Base ?They''re defined either as instance variables, or as hash parameters to the render_message() function. For your reference, a large snippet from the top of the ActionMailer::Base docs: class ApplicationMailer < ActionMailer::Base # Set up properties # Properties can also be specified via accessor methods # (i.e. self.subject = "foo") and instance variables (@subject = "foo"). def signup_notification(recipient) recipients recipient.email_address_with_name subject "New account information" body { "account" => recipient } from "system@example.com" end # explicitly specify multipart messages def signup_notification(recipient) recipients recipient.email_address_with_name subject "New account information" from "system@example.com" part :content_type => "text/html", :body => render_message("signup-as-html", :account => recipient) part "text/plain" do |p| p.body = render_message("signup-as-plain", :account => recipient) p.transfer_encoding = "base64" end end -Ben
On 12/30/05, Vivek Krishna <krishna.vivek@gmail.com> wrote:> Hi Joe, > An unrelated question .. I am trying to use action mailer but I am having > problems with the views .. Where exactly do the variables in the view come > from .For example in your code you use @url. Is this an instance variable > you created in your Mailer < ActionMailer::Base ?In whatever Mailer action you''re working with, put @body[:url] = whatever a url is Then, in the views, you''ll have access to the @url instance variable.
Hi all, I am creating a ruby app which allows users to request changes to the DB. The requests will be routed to the DBA and the DBA will authorize it. So far good. No issues. The issue arises when I want to give the DBA an option of migrating the changes to other schemas as well. How do I have more than one schema mapped to one app? Thanks. -- saleem