search for: template_path

Displaying 9 results from an estimated 9 matches for "template_path".

2005 Dec 19
1
Preserving fallback with RJS
...looking for a way to specify when I want to render an RJS template over another. Thoughts? Also, I''ll show the code that I think pertains so you can see what might need to be changed. Looking at the render code which controlls which template we go to... def pick_template_extension(template_path)#:nodoc: if match = delegate_template_exists?(template_path) match.first elsif erb_template_exists?(template_path): ''rhtml'' elsif builder_template_exists?(template_path): ''rxml'' elsif javascript_template_exists?(template_...
2008 Sep 08
2
Problems with async worker request
...drb to handle asynchronous pdf creation, but in doing so, I''ve run into a very strange problem. Below is a method that''s called from the controller which creates a new worker, then grabs the worker and calls the ''build_pdf'' method asynchronously. def make_pdf(template_path, worker_key) with_empty_asset_id do html_string = render_to_string(:template => template_path, :layout => ''pdf'') key = MiddleMan.new_worker(:worker => :prince_xml_worker, :worker_key => worker_key) MiddleMan.worker(:prince_xml_worker, key).async_b...
2011 Mar 04
1
How to modify the template path for ActionMailer used in a Ruby script ?
...tml, :rxml], :formats=>[:html], :locale=>[:en]} in view paths notifier.rb class Notifier < ActionMailer::Base default :from => "system-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" def joinus_email(destination, coupon) @url = "http://example.com" mail(:template_path => ''notifications'', :to => destination, :subject => "Welcome") do |format| format.html format.text end end end I believe there is something wrong with the :template_path => ''notifications'' parameter... I tried a r...
2005 Oct 24
3
Custom View Location
Hi, I would like to have the ability for my application''s .rhtml files to be customized after I give my app to a client. However I don''t want them to mess with the existing templates. Basically I would like to look in a directory lets say "customize" which would be off the RAILS_ROOT directory. If a .rhtml is in the "customize" there use that one, if not
2011 Feb 21
2
self.prepend_view_path - am I missing something
I have an app that varies its content based upon the domain from which it is being accessed. Some of the domain characteristics are supported in the model but it is easier varying static text in the views and then sharing the form templates via partials etc. Rails 2.3.10 and looking at the documentation at
2010 Oct 20
7
How can I render a template outside of a controller in Rails 3?
...as been helpful, and I eventually found some useful info at http://www.swombat.com/rails-rendering-templates-outside-of-a-contro. However, this seems to be broken in Rails 3. Does anyone have any ideas how I can fix this method or perhaps know of a better approach? My method: def render_erb(template_path, params) view = ActionView::Base.new(ActionController::Base.view_paths, {}) class << view include ApplicationHelper end view.render(:file => "#{template_path}.html.erb", :locals => params) end The error: ActionView::Template::...
2011 May 20
5
views w locale default template
[RAILS3] I hesitate on how handling the locale view templates to default to one language only .. sending admin emails will go only to one locale ''en_GB'' should I set it up into the template name and set I18n.locale to ''en_GB'' membership_renew.en_GB.html.erb OR whatever locale is used , if I have : membership_renew.html it will be the default ? --
2006 Jan 12
3
ActionMailer bug?
Hi , I have actionamailer working properly with a template and a model for creating the mail object etc. The whole thing works correctly if I use Webrick.but when I use it on Apache,i get the error which says "template missing".rails is unable to find the template for the mailer object.Hasanyone noticed this? Vivek PS:I am still not using the 1.0 version -------------- next part
2007 Aug 14
12
expect_render, why does there need to be a warning
There is a warning on the web site about expect_render and stub_render: "WARNING: expect_render and stub_render, while very useful, act differently from standard Message Expectations (a.k.a. mock expectations), which would never pass calls through to the real object. This can be very confusing when there are failures if you''re not aware of this fact, because some calls will be