similar to: Render to file ?

Displaying 20 results from an estimated 100000 matches similar to: "Render to file ?"

2006 Aug 17
3
How to save output "render :action=>:any_action" to a file?
I need to save the output of my rails app to a file. i.e. instead of rendering a page when using "render :action=>:any_action" i want the output to be saved to a file. Anyone got any ideas? Thanks Chris -- Posted via http://www.ruby-forum.com/.
2010 Mar 17
3
rails+prawnto: setting :type to :prawn in a #render_to_string call not working
Hello, my question is rails related though it is also somewhat specific to the prawnto plugin (installed latest version as of 2010-03-15). I would ask on a prawnto forum/list if I knew where one was. Anyhow, I''m using rails 2.3.5 (with ruby 1.8.6 patchlevel 111) in an app that is successfully using the prawnto gem (with the prawn gem version 0.7.1). I''ve got a a
2008 Dec 20
4
Accessing rails helpers when processing erb snippets
I need to be able to merge a lot of content for web pages, along with links to other pages taken from a list of categories. The text that goes with each category can be different depending on the context that it''s displayed in. I could do this by having a whole stack of *.html.erb files which hold the static content and access the Rails helpers to pull in stuff from the database and
2005 Dec 27
6
avoid multiple render per action
Hello, I have a hash that contains categories, and each category ID is a hash of subcategories. What i want to do is dynamically load that hash, loop thru it, for each category , subcat run a query against the DB, and render a partial. The issue is i put the render:partial in a for loop but you can only render once per action. What is the best way to loop thru all my categories without a
2006 Feb 20
3
Background work
Greetings, I''ve got a rails app which is basically an admin interface to a xml dataset. Currently I''ve got rails rigged to call a function to spit the entire dataset to file with every change. This would actually be ok, its fairly infrequently updated, but when the dataset grows large the user sits there waiting for it to dump with no feedback as to whats going on. Oh yes,
2006 Feb 12
3
Invoke render multiple times
I need to invoke render() multiple times. This is not to render a response to the browser but to get the result of render() and put it in files. Is there another way to do it if it''s not possible to do it directly with render()? Btw, what''s the reasoning behind only allowing render() to be called once a request? /Marcus
2006 Jun 30
1
How to force redirection after a render on PDF::Writer?
Hi to everyone, In my Rails experimenting, I''ve come to a point where in the application happens what follows. 1. Upon selecting some stuff on a page, the user click on a button. 2. After clicking I need to: 2.1 Produce a PDF with some "Pretty Useful Information(TM)" 2.2 Bring the user to another page The PDF being produced with PDF::Writer requires a "render"
2010 Jul 04
2
Rendering a different format in the implementation of a renderer
Yehuda has a nice article on implementing a custom renderer for PDF at http://www.engineyard.com/blog/2010/render-options-in-rails-3/ I''ve tried to follow the example and I''m not sure I see how to get it to work. If I understand things correctly, the format(s) usable in this render call respond_with(@resource) do |format| format.xyz { render :xyz => ... } end
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
2006 Jun 16
2
image_select_tag with name and value
What have I missed I have a .rhtml with the sandard form parameters <%= image_submit_tag("excel.gif", :alt => "Download List to Excel", :border => 0, :name => ''render_action'', :value => ''excel'' ) %> Which genenerates I believe a valid html fragment for a submit button. <input alt="Download List to Excel"
2006 May 17
6
White Screen of Death
Hello, I''ve heard these words to describe a RoR application returning an empty page. This happen from time to time even here, in the forum. That is the cause of this misbehaviour ? Is it related with something external to RoR itself ? What is the solution to avoid the WSOD ? -- Posted via http://www.ruby-forum.com/.
2006 Jul 06
5
Building a standalone application with RoR
Hello, I have to code a small application for a car repair shop running under Windows (98 SE but may be my client could upgrade to 2000) and using RoR is my definite choise ! The app will be powered by WebRick (which is enough powerfull for a small app used by only ONE user at a time) My questions are targeted to the best database to use... I had a look to SQLite and Firebird but support
2006 Dec 17
12
Best practices for conditional display in views?
Hi. I am writing an application that has a lot of boolean conditional display logic, like this: <% if user.description then %> <p class="css_class"><%= user.description %></p> <% end %> Often the displayed content is more complex than the above, and to clean up my views I am trying to pull a lot of this sort of thing into partials. However, the problem
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 May 26
6
Help needed with acts_as_list
Hi ! There must be something I don''t understand clearly in acts_as_list I have a list of gallery entries (images + text), model is GalleryEntry. I have a field in_exhibition (boolean) I want the list to be sorted with a scope on in_exhibition : from 1 to N for every record having in_exhibition = false and 1 to N for every record having in_exhibition = true When I use acts_as_list
2006 May 18
3
Render layout on the fly
Hi guys, i was wondering if there is any possibility to render a layout on the fly instead of putting it into the layouts/ folder. Any ideas? -- Posted via http://www.ruby-forum.com/.
2006 Aug 04
8
I need an idea !
Hello here, I need to find an idea to solve a problem I manage Events which are of kind :arrival or :departure At first the two kind of events was unrelated but my client want to see the :departure belonging to the :arrival and vice versa. I''m searching for a solution to implement this ''link''. I''ve thought about an integer column containing an uniq id for
2006 May 26
1
render_file works, render :file doesn''t
I have these two bits of code: <%= render_file @item.path, false %> <%= render :file => @item.path, :layout => false %> The first line works, the second doesn''t (results in a blank page - nothing in the logs either). Any idea what the problem is? Joe -- Posted via http://www.ruby-forum.com/.
2006 Mar 13
2
how do I render a partial view into a string from inside a view ?
I want to pass the partial to a Javascript function ( which uses the data for for creating an iframe) render_to_string is not accessible form a view thanks in advance -- Roberto Saccon - http://rsaccon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060313/8165bcec/attachment.html
2008 Dec 18
2
Render a view from console
Hello! In my application I''m trying to render a view from a class in /lib folder. I have found that it''s very similar to render a view from console. So, I have tried different methods: >> string = ActionView::Base.new.render( :inline => ''works'', :layout => false ) => "works" >> string = ActionView::Base.new.render( :template =>