Displaying 20 results from an estimated 40000 matches similar to: "My partial wont render if there are line breaks (!?)"
2008 Jul 17
0
render partial vs. render subtemplate?
Can anyone shed any light on the pros/cons of one vs. the other?
Certainly the "render partial" option is advantageous as an
abstraction of one or many objects and what to do with them. But I''m
noticing that my code is starting to have lots of partials and I
wonder where subtemplates fit in?
Are there some best practicies for partials vs. subtemplates?
Thanks!
-Danimal
2009 Apr 28
0
google adsense breaks render :partial =>
Hey everybody, i''ve got a control that returns a partial, no biggie.
Except when that partial contains the javascript for my adsense account.
Then the partial renders correctly, and then quickly replaces my page
with nothing by the ad. When i take away my adsense js, everything works
great. Has anyone encountered this before, or know how to get around it?
def submit_remote_form
render
2010 May 19
0
render html partial from atom builder
So I have an action that results in atom:
def index
...
respond_to do |format|
...
format.atom { render :layout => false}
end
end
Then I have a builder template to render the atom, called
index.atom.builder.
Inside this builder template, I''d like to render one of my existing html
partials, to put in the atom:content element, perfectly normal atom
thing to do.
2012 Mar 27
4
render :js => "window.close();" wont work
when i try to do the following in a action
render :js => "window.close();" wont work
it still response in the browser,but the window wont close.
i dont know why.thx!
--
*愿爱与喜悦心与你同在!
石岩敬上
大连东软信息学院 计算机系软件工程应用方向
Dalian NEUSOFT Institute of Information
中国-大连市软件园路8号
邮编:116023
**Mail:hlcfan.yan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org*
2012 Jul 19
6
Rendering Partial
I am a bit confused when coming from layout and partials.
To start of I have a file called application.html.erb which has my
layout such has follow
<html>
<head>
<body>
<%= render ''layouts/footer'' %>
</body
</html>
This call a new file _footer.html.erb
This file his has follow
<footer class="footer">
<nav>
<%=
2006 Feb 02
2
multiple ''render :partial'' in a helper ??
Hi all,
I''d like to move some view code to a helper but it doesn''t work because
I need to render two partials each time.
Q: Is it possible to do this with a helper?
Example:
-----------------
Before: In the view:
...
<% case controller.controller_name
when ''member'' %>
<%= render :partial => ''shared/member_menu''
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having
to feed the javascript directly to the page object as couldn''t find a
way to have insert_html work directly on the proxy object returned by
select.
However, that''s not the problem. The code for doing that is below and it
all works fine, except that a new line is being inserted after the
2006 May 17
3
RJS behave differently than render :partial?
I have a method in my controller like the following (the syntax may not
be correct, I''m doing this from memory - you should be able to get the
idea though) My rhtml page has a DIV with id="country_areas", which
contains a partial that only makes a drop down of country areas for a
specific country. When changing the country in the country drop down, it
uses the
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 => {
2006 Jan 02
3
Re: Getting Index When Using render :partial (Benjamin Stiglitz)
Thanks for the suggestion, Ben. This seems an excellent approach to
the problem, except that I''d been under the impression that one could
only call render once. If you call it multiple times as the
each_with_index loop iterates, are the results just combined
automatically? How does that work?
Thanks!
Sean
-----
Sean McMains
AIM: SeanMcTex
http://www.mcmains.net/ruminations
On
2009 Mar 05
3
How to render :partials *before* the :action has finished ?
Hi there,
I''m sure a lot of you guys have come across this question:
How can we render several :partials on a page *before* the called
:action has finished?
Basically, my situation is this:
When I click on a certain button, 3 things are supposed to happen:
- INSTANTLY: the button should become disabled (either by setting
":disabled" to "true" by updating the
2006 Jun 27
2
Render partials in folders
Right now I have partials in a view folder corresponding with my controller.
ie: controller: example, view: example/_partial.rhtml
and I call it with render :partial => ''partial''
How do I add the partial to another folder and call it?
ie: controller: example, view: example/new_folder/_partial.rhtml
render :partial => ''new_folder/partial'' # does NOT work
2006 Jul 13
3
Performance diff between rendering partial vs. calling a helper?
Hi,
Is there any performance difference between rendering partials vs. calling a
helper? When we initally started coding we built a bunch of small partials
and if there is a significant performance overhead with them, we''ll probably
try to switch them over to helpers. They seem like they would be quite
similar but I don''t know the full details of how partials are handled.
2011 Mar 01
6
render :collection calling partial with phantom object?
I have two models with a straightforward has_many / belongs_to
relationship:
class Premise < ActiveRecord::Base
has_many :metered_services, :dependent => :destroy
...
end
class MeteredService < ActiveRecord::Base
belongs_to :premise
...
end
and nested routes to match:
Demo::Application.routes.draw do
devise_for :users
resources :premises do
resources :metered_services
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly
completing my spanking new ajaxified UI. What is the motivation behind
this, and what is the best workaround?
This UI does a scriptaculous drag-and-drop of items from a first div
(div1) over to a second div (div2), which triggers the contents of div2
to be updated to reflect the drop. No prob, thus far. But then the
2006 Jul 13
6
Render partial questions
Hello,
what is the preferred way to do this...
I have 2 controllers. Each has an index action.
Now I want to include the rendered index view from TwoController in the
index view of OneController.
But a render :partial doesn''t execute the TwoController index action
which sets variables for its index view.
So maybe you can give me a short example how to do it.
Thank you
Markus
2006 Apr 30
4
renamed partial won''t render?
hi all
this works
<%= render :partial => "admin/works/work", :collection =>
@artist.works %>
but this doesn''t
<%= render :partial => "admin/works/worklist", :collection =>
@artist.works %>
even though the partial _work.rhtml and _worklist.rhtml are identical.
worklist.rhtml throws
undefined local variable or method
2006 Jan 02
2
Getting Index When Using render :partial
I''m using a web service to retrieve an array of results to a search
and a render :partial to display those results to the user, while at
the same time putting the results into the session. Is there a way
for my _book.rhtml file to have access to the index of the result
currently being displayed, like each_with_index makes available to
its block? This would allow me to have the
2006 Feb 05
6
render partial -- show certain content only if...
i''m working on a _post.rhtml partial, and it displays one blog post.
i''m accessing this partial on the list.rhtml and the show.rhtml
what i''d like is to only show the "link" link on the list.rhtml and not
on the show page.
<%= post.title%>
<br />
<%= post.body%>
<%= link_to
2006 May 16
4
question about strftime when called from partial.
Hi,
I''m calling a helper I''ve written - format_time() that is called from my
views with a given time that was selected from my database and was returned
to the view via an instance variable. When I call format_time from a
partial, I see that I get some kind of String error and the partial won''t
render. Basically, the object being passed in to format_time is already a