Displaying 20 results from an estimated 60000 matches similar to: "partials and content_for"
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header,
sidebar, footer, and content. However, when running a view spec, the
`rendered` variable seems to only contain a string of just the primary
content and ignores the header/footer/sidebar as well as the rest of my
layout file (the "render" call just returns my primary content wrapped in
generic <html> and
2008 Sep 17
2
Layouts and content_for
when i studied the tutorial about layouts & content_for from railscast.I
need a clarification as per their tutorial.
url:http://railscasts.com/episodes/8-layouts-and-content-for
<!- projects/index.rhtml ->
<% content_for :head do %> <= stylesheet_link_tag ‘projects’ %>
< end %>
<!- layouts/application.rhtml ->
<head> <title>Todo List</title>
2006 Jul 24
2
BIG JS limit? Using replace_html with partials containing JS
Hello,
It''s pretty hard giving a practical example on this one.
I have a partial which contains some generated Javascript.
Something like:
order_screen.rhtml
-------------------------------------------
<h1>Order</h1>
<div id="order_part">
<%=render :partial=>''order_new'' %>
</div>
<h1>Ordered products</h1>
2008 Apr 19
4
Is testing output within content_for possible?
I wanted to test that the links below were being rendered in the views.
- content_for :sidebar do
%ul.links
%li= edit_link edit_admin_contact_url(@contact), "Contact"
# view test
it "should have the correct side bar links" do
do_render
response.should have_tag("ul.links") do
with_tag("a[href=?]",
2009 Sep 23
0
[PATCH server] consolidated network & routing info ui's
created/edit network information is all specified on
one simpler form
---
src/app/controllers/network_controller.rb | 27 +++++++++++++++----
src/app/models/bonding.rb | 2 +-
src/app/models/network.rb | 2 +-
src/app/models/nic.rb | 2 +-
src/app/views/network/_form.rhtml | 15
2006 Mar 20
1
AJAX in conjunction with partials
All,
Trying to clear up some confusion on my part.
If I make an Ajax call using Ajax.Request and in the controller method
that I call, I do a render (:partial => ''whatever.rhtml''), should I
expect that ''whatever.rhtml'' will be rendered in the browser or not?
Put another way, is it in any way reasonable for me to think that
Ajax.Request + partial render
2007 Jul 16
0
Partials vs. Helpers
I have several partials containing dynamic codes (already memcached all
the fragments as best I could), which I reuse ( render :partial =>
"stuff.rhtml" ) a lot within a single action call. For example, I have a
partial which defines how an entry is to be formated in HTML. I have 40
entries on a page, so the partial is rendered 40 times in a single
action.
Not knowing the
2006 Sep 26
0
Is it possible to render RXML partials in RHTML templates?
I have a RHTML template and I would like the output of a RXML partial to
be embedded within it.
When I do <%= render(:partial => ''list_edit'') %> where there exists a
_list_edit.rmxl file, I get XML parsing errors in the browser - I
believe because the partial is causing the rendered content to be
identified as XML instead of HTML.
Is there any way to
2006 May 21
3
Where to put partials called from the application layout
Hello,
My main application layout, app/views/layout/application.rhtml looks
like this:
something
render partial_1
something else
render partial_2
something else
render partial_3
The partials are not really doing anything, i use them to keep the
layout modular (i.e . to have ~30 lines instead of 200). Now, the
question is where to put _partial_1.rhtml, _partial_2.rhtml,
_partial_3.rhtml.
If i am
2010 Aug 26
1
[PATCH] Adding the ability to select a Host to start a VM
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 5 ++
src/app/models/vm_task.rb | 4 +-
src/app/views/vm/start.rhtml | 77 ++++++++++++++++++++++++++++++++++
src/task-omatic/taskomatic.rb | 7 +++-
4 files changed, 91 insertions(+), 2 deletions(-)
create mode 100644 src/app/views/vm/start.rhtml
diff
2006 Mar 22
3
Rendering partials in ActionMailer?
Hello,
Is anyone out there rendering partials successfully in ActionMailer
templates?
I am having trouble with this, and wasn''t sure if it was my
configuration or something with a version of Rails I''m running.
We''ve got over 15 mailer templates, all working like a charm.
But we have a piece of shared code, that we''d really like to not have to
copy &
2010 Aug 25
0
[PATCH] Adding the VM Pool migration for vms
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 16 +++++++++++++
src/app/views/vm/edit_vmpool.rhtml | 39 ++++++++++++++++++++++++++++++++
src/app/views/vm/show.rhtml | 3 ++
src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes
4 files changed, 58 insertions(+), 0 deletions(-)
create mode 100644
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
2008 Mar 11
1
view spec on rails questions
Hi
I have a couple of questions
1)
how do you test the response inside a content_for block
I see reference to it in the release notes but dont know where to
find it (tried http://rspec.info/rdoc-rails/ )
2)
I dont seem to be able to stub partials in a different directory eg
<%= render :partial => "foos/show" %>
And I put this in the spec
template.stub_render(:partial =>
2010 Sep 01
1
[PATCH 1/3] Adding the VM Pool migration for vms
Signed-off-by: Simon COURTOIS <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 16 ++++++++++++++
src/app/views/vm/edit_vmpool.rhtml | 36 ++++++++++++++++++++++++++++++++
src/app/views/vm/show.rhtml | 3 ++
src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes
4 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644
2006 Mar 27
2
Trouble with rendering partials
This only works when the partial name matches the object name; if I
change "threadtop" to "thread" then it works fine. Is this normal? I
get the following error otherwise:
"undefined local variable or method `thread''"
index.rhtml
---
<% for @thread in @threads %>
<%= render :partial => ''threadtop'', :object => @thread
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
Hi guys,
I am a Rspec newbie and am having problems creating a spec for a RoR helper
method.
I have in fact already implemented the helper method and am trying to create
retrospective specs. I know its the wrong way to do it but I am still
learning Rspec.
In my view I have a call to a helper method.
<% body_class "users" %>
which sets a CSS class declaration in the content_for
2005 Oct 15
1
Partials and controllers
Newbie question:
From a _form.rhtml file I have:
<%= render(:partial => ''item'', :collection => @items) %>
In _item.rhtml I have:
<% @tullt = h(item.body) %>
<%= @itemdb = Group.find(:all,
:conditions => "id = ''#{@tullt}''").map {|u| [u.name] }
%>
<%= @tullt %
I think it would be better to
2006 May 10
4
using partials in a for loop
I''m trying to write a partial for a link_to_remote that i''m using over
and over again, but simply moving the code to a partial doesn''t seem to
work.
Here is how I have it set up:
class_planner.rhtml:
<% for course in @courses %>
<%= render :partial => "class_list" %>
<% end %>
_class_list.rhtml:
<li>
<%= link_to_remote
2006 Aug 17
2
RJS - slower than normal RHTML?
I know that isn''t supposed to be the case, and it usually isn''t, but
today, I''ve run across a situation where rendering the same partial
through RJS is taking about 5 times longer than rendering the partial in
the RHTML.
I have in my main RHTML
<tbody id="account_transactions">
<%= render :partial =>