similar to: Rails3: render_to_string of a .html.erb when request is a json request raises MissingTemplate error

Displaying 20 results from an estimated 1000 matches similar to: "Rails3: render_to_string of a .html.erb when request is a json request raises MissingTemplate error"

2010 Nov 04
0
Re: Train wreck getting render_to_string to work from foreign controller [SOLVED]
Just for collective knowledge as I have found no info on this problem online: I solved this by adding an .html.erb file for the "missing template", since by design or bug Rails3 will not find or render another controllers view (in my experience). Then in the new html.erb file, I just put <%= render "comparisons/display" %> because the views *are* able to find templates
2011 Nov 24
2
This is not the error: ActionView::MissingTemplate
Hey everyone, I am getting the following error: Started POST "/rubyamf/gateway" for 127.0.0.1 at 2011-11-24 16:27:20 +1300 Processing by RubyamfController#gateway as */* Processing by ProjectsController#templates as */* ←[1m←[36mProject Load (1.0ms)←[0m ←[1mSELECT `projects`.* FROM `projects` ←[0 m Completed 200 OK in 34ms (Views: 3.0ms | ActiveRecord: 28.0ms) Completed 500
2012 May 28
1
rendering a partial inside another using render_to_string and (:formats) in controller
I want to clean my code by moving the duplicated lines : partial = render_to_string( :partial => "#{file}", :formats => [:html] ) to the pagination_partials function. ================================================= WORKING CODE: ================================================= def render_format_search_partial(file, options={}) # TODO remove this line to use the one
2010 Mar 25
0
Rails 3.0 + haml render partial ActionView::MissingTemplate
I''m upgrading one of my apps to rails 3.0 I get this error: ActionView::MissingTemplate Missing partial /layouts/header with {:formats=>nil} in view path for: = render :partial => "layouts/header" the file is in views/layouts/header. From the error message, it looks like it appends an absolute path: "/ layouts/header" Anyone has seem this problem when
2012 Nov 27
1
controller not rendering existing js.erb file
In my PlaceController, I have a search method, called remotely from a form the method is executed, but rendering is not executed as the template is stated as missing .. but it''s there ... post :search, :locale => I18n.locale, :format => :js, :country => "United" Error: test_should_search_places(Backoffice::PlacesControllerTest) ActionView::MissingTemplate:
2006 Mar 06
0
Weird MissingTemplate error in production only
Hi Folks! I''ve been using Rails for more than a year now and I''ve been struggling with a very strange issue since last week. My Rails app won''t render any template when running in production environment. All actions (even the default behaviour when the action is left empty) will fail in assert_existance_of_template_file. If I force the full absolute path down the
2011 Mar 06
2
render_views and render_to_string
Hey guys. One of my controller actions uses #render_to_string to send back a JSON response. When I try to spec this, Ruby raises a NoMethodError, saying that #render_to_string doesn''t exist in my controller action. Here''s the controller action, spec, and output: http://pastie.org/1640962 Any idea what I''m doing wrong? Thanks, Nick -------------- next part
2007 Nov 25
2
Fwd: Render_to_string from a worker
Hi, I am trying to generate a PDF from within a worker using PDF::Writer. In my controller I use render_to_string to create the pdf file however from what I understand render_to_string can only be used from a controller. Does anybody have any suggestions how I might be able to replicate this functionality in a worker? -- thanks, Felix -------------- next part -------------- An HTML attachment
2006 Mar 08
0
render_to_string() in a controller that isn''t default route?
Is it possible to call render_to_string() in a controller that is not set as the default route? The content controller is set in routes.rb: map.connect '''', :controller => "content". The content controller is calling a template controller, and I would like to be able to call render_to_string() within the template controller, however I receive the error:
2009 Jun 23
0
render_to_string inside method shared across several controllers
I use render_to_string to generate short reports (in HTML) under certain conditions when users access my application. The reports are stored in the database and uses database information at the time they are generated (and can thus not be generated later, e.g; when you want to consult them). The reports are generated the same way regardless of which controller has been accessed. Conditions for
2006 Apr 20
0
Using render_to_string in other custom classes
I have a project where I''m publishing files. Once when the user clicks publish via a URL and one when an email is received that tells the app they want to publish again. Because the publishing requires templates I have them in there own views. The problem is when I want to publish via email I don''t want to ask the controller to render the views. This is what I tried to
2012 Mar 31
0
Missing Template Error on render_to_string - Rails 3.2.2
Hi, I''m trying to execute some javascript in the browser after completing my create action in the controller. Here''s how I''m doing it: In my controller: def create # exectue some code js = render_to_string(:layout => false, :template => "planned_meals/meal.js.coffee.erb") render :js => js end Two questions: 1) Am I going about it the
2006 Jul 05
3
Calling render_to_string from a view
I''m playing around with a list of todos, which I want to render as <ul>''s that can nest to an arbitrary level, so I wrote this as a helper method: def print_todo(t) str = "<ul>\n\t<li>" str += render_to_string(:partial => ''todo'', :object => t) + "\n" t.children.each { |c| str +=
2007 Apr 19
4
render_to_string in a model ?
I have a batch job that will call script/runner, I would like in this call to create html formated email and save it to the database. This is easy enough in a controller with yournewhost.email = render_to_string :action => "email_newhost_ready", :layout => false But render_to_string is only available in controller action pack, is there a easy way to render_to_string in a Model? Or
2006 Mar 27
0
render_to_string troubles
Hi, I''m trying to build a simple mechanism for pre-caching a bunch of files by iterating over a hash of options from within a controller: #site.controller: for options in [ { :controller => "site", :action => "welcome" }, { :controller => "site", :action => "about" }, { :controller => "site", :action
2011 May 17
1
rails render_to_string problem
Hi I`m trying to test my controller with rspec and always get an error. The error is in the render_to_string method call (without it test works fine). So could u please help me with that? users_controller.rb: def update @user.update_attributes!(params[:user]) redirect_to @user, :status => 202, :text => render_to_string(:partial => "users/show", :type =>
2007 Jun 11
0
render_to_string from within the worker?
Is it possible to call render_to_string from with in a brb worker? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070611/21c1821a/attachment.html
2006 Aug 03
0
render_to_string without render twice error
When I have a user go to a certain page, it will fork off a thread that will perform some action. So the main thread will finish and render :nothing => true . Now, I want that forked off thread to render into a string a partial. However, I cannot render_to_string :partial=> :foobar because I have already rendered once. Is there anyway to get around this? -- Posted via
2006 May 26
0
render_to_string in model or script/runner?
Hey, is there a way to render a view to string in a model or is there a way to call a controller method (because there its possible to call render_to_string) in a model or externaly via script/runner ? Thx very much yo
2006 Apr 07
0
render_to_string and DoubleRender error
Hi all, I''m trying to use render_to_string in a controller in order to make an output file for download, and then redirect to a "Thank you for downloading" page. Of cource, this is not possible since one cannot have a "render" and "redirect" in the same action. Anyone know how I can do this? -cal