similar to: Double Render Error...

Displaying 20 results from an estimated 3000 matches similar to: "Double Render Error..."

2006 Mar 12
0
Unexpected attribute modification
Hi all, I''m trying to do multiple render_to_string() calls in a method call, and I''m getting attributes being modified in unexpected ways. @left_sidebar = render_to_string( :partial ..... ) puts @left_sidebar.id (-> 123456) @right_sidebar = render_to_string( :partial .....) puts @left_sidebar.id (-> 234567 WTF!?!?!) puts @right_sidebar.id (-> 345678)
2006 Mar 17
2
How to let the layout be more OO?
I am confused about the @content_for_layout.''cause it will display all the views in the layout.Do I have any methods to let the layout be more OO? I mean that for example,the app currently have more than one views to be displayed,but only some of them to be displayed at the same time at different <div></div> units. I hope there exists a kind of way that: <%= if
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial that is sent to a web service. Here''s the code: class MyController < ApplicationController after_filter :post_to_webservice def show # show logic end def post_to_webservice stuff = render_to_string :partial => ''stuff'' webservice_post(stuff) end I get a DoubleRenderError in the
2006 Mar 08
1
Components calling components...
Hi, I''m relatively new to ruby and rails. I would like to have a sidebar component call one of several other constituent components. I''ve run into some problems, and so I''ve pruned things back to a relatively simple case. I have a sidebar component. Renders great. In it''s layout, I call render_component for another component I would like in the sidebar.
2006 Jul 06
0
Layouts, Searching/Sorting
Two questions for you all... 1. I have an admin section to a site I''m building. Here''s the pertinent bit of the layout that all controllers are using: <div id="main-content"> <%= @content_for_layout %> </div> <div id="sidebar"> </div> I''m using @content_for_layout to display various controller actions such as new,
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
2007 Aug 23
2
Render partial from Backgroundrb worker?
Hi, I have a long running task which generates JavaScript to files and I am hoping to move this to a backgroundrb worker. The javascript is currently generated with call to render_to_string: File.open(File.join(target_folder, ''all.js''), "w") do |file| file.puts(render_to_string :partial => ''partials/shared/javascript/tags'', :locals => {
2011 Feb 25
1
PDFKit javascript issues
I also posted this on stackoverflow so apologises for cross posting but I think this is probably a better home for this post. I have been looking into using PDFKit to generate pdf reports for a Rail 3 app I''m working on. Basically if I use PDFKit as middleware any page in the app is nicely rendered to a pdf including the javascript generated graphs. However, I want to use a different
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
Greetings, I''m a newby to both "R"s in RoR. I would like to use Builder::XmlMarkup to generate my pages. If there is a working downloadable example somewhere, that would probably be enough. Otherwise, here''s what I want to do: With the following controller: class AccountsController < ApplicationController layout ''accounts'' model :account
2005 Dec 16
3
Purpose of ''yield'' in layout file in Flickr video?
During the excellent flickr video, the presenter adds the following to the applications layout file: <body> <%= yield %> </body> What is the purpose of the ''yield'' line? I would think there would be a content_for_layout tag there instead. Thanks, Don -- Posted via http://www.ruby-forum.com/.
2013 Feb 28
1
how to use before_filter to decrypt post data
hello, everybody. in ror, we can add a after_filter to a controller. def aes_encrypt response.body = AesHelper.aes_encrypt(response.body) end after_filter :aes_encrypt and all action''s repsonse int the controller can be encrypt. and my question is , how to decrypt data use before_filter, or anything else. ex: i want to post json data to /usr/register, the json data is
2007 Jun 21
1
render :partial => :url - is it possible?
Hi, this is my first post to the list. I''m still learning the rails framework, having done most of my previous web development in PHP. I''ve done a bit of googling for the answer to this question, but maybe I''m just lacking the right word to search for. Several parts of my site, such as sidebar components, are self-contained, modularized and re-used in several parts
2006 Apr 18
2
link_to_function onmousedown
Hi, Is there some way to produce an anchor that looks like the following using helpers, or should I just code it in the rhtml like this? <a href="#" onmousedown="javascript:foo(); return false"> Thanks, Brad -- Bradley Mazurek
2008 Sep 13
2
<meta http-equiv="refresh" content="5"/>
Do you know of any way for me to stick a meta tag in using a before_filter or after_filter or around_filter? <meta http-equiv="refresh" content="5"/> I have been trying to figure out out and just cannot make sense of it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 May 24
1
How to marshal Javascript data?
I''m trying to marshal some information I have in Javascript, and send it over an AJAX request to the server, specifically to be stored in a model on the server side. I have some Javascript routines I wrote that gather information about the user selection. I see that the link_to_remote has a :before option in which I can write Javascript to collect what I need, but right now I''m
2006 Apr 04
1
Manipulating has_many :through associations
Hi, I haven''t done any associations before, so please forgive my incorrect use of terminology... If I set up a has_many :through association, can I manipulate the associated instances directly (like an Array), or do I need to manipulate the join model? For example, suppose I have two classes and the associated join model: class foo has_many :foo_bars has_many :bars, :through
2009 Jul 14
1
How to add after_filter-style render
Hello I would like to execute specific action rendering something into page after each of my ajax calls. In example I would like to update some div or display an alert. How I imagine it could work is as follows class ApplicationController < ActionController::Base after_filter :do_something_after_each_ajax_call def do_something_after_each_ajax_call if request.xml_http_request?
2009 Feb 22
0
Using after_filter to remove image after render
Hi Everyone, I tried doing this and it''s not working as I would expect it, but I''m not sure if it''s even possible. I have an app that generates and image on request and displays it to the user. To cut back on storage, and some security, I''d like the app to receive the view request, render the image, display it, then delete the file. I know this isn''t
2006 Jun 09
8
Installation on OSX...
Hi, Just got my first Mac. I''m trying to install rails on it, using the instructions in the rails wiki: http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTigerUsingDarwinPorts I go to install mysql, and the version of mysql supported by DarwinPorts appears to be 4.1.18. But all the sites appear to only have 4.1.19 or 4.1.20. So it looks like DarwinPorts is over a month out
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