Displaying 20 results from an estimated 72 matches for "content_for_layout".
2006 Jul 13
6
Content_for_layout
Question- if I have more then one view I wish to display in a layout , how
do I tell content_for_layout what to display and where ?
TIA
Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/a2d0a8c8/attachment.html
2006 Aug 09
3
[Markaby] yield instead of @content_for_layout?
We''re supposed to use yield instead of @content_for_layout, but I can''t
get yield to work in a Markaby template:
yield
text yield
Either one of these lines results in a ''no block given'' error (but ''text
@content_for_layout'' works). Anybody know how to use yield instead?
Thanks,
Joe
--
Posted via http://w...
2006 Feb 15
5
Formating @content_for_layout
Hi all, I sent a message earlier, so forgive me if you have already
read this (I got some cryptic message in German about how my
e-mail was not read?). Anyway, I was just wondering if there was
any way to format the html that is output using
<%= @content_for_layout %>
I want to use something like the PHP Beautify. I guess I could
write my own, but I was hoping that Rails already had something
built in. Thanks to all. Have a great day.
--
Topher Fangio
fangiotophia@gmail.com
http://www.fangiotophia.com
Website Specialist
Fangiotophia Designs
(325) 660-71...
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout
test_controller
def list
layout "stdlayout"
end
in the views/test/layouts stdlayout.rhtml
<html>
<head><title>test</title></head>
</body>
<h1>Test</h1>
<%= content_for_layout %>
</body>
</html>
2) I get Rails Application Error when trying to use a separate display page
I create a method in the test_controller
def welcome
end
in test/views I create an html page called welcome.rhtml
what am I missing ? thanks.
2006 Jan 23
8
yield vs @content_for_layout, etc..
I am relatively new to RoR and Ruby for that matter. A few questions
for the pros:
Question 1:
In the 5min ajax video the presenter uses
<%= yield %> in his layout.
In the agile book, @content_for_layout is used.
Since, yield is an actual Ruby construct, is it more efficient and
preferred? What is the difference?
Question 2:
Links are often of the form :action => ''some_action'' However, I have
also seen :action => :some_action Which form is preferred? Why does
th...
2006 Jul 27
3
Multiple @content_for_layout in template?
...lumns in it, a main content
column and a thin side column. The content in each of these will change
on each page of the site but I''m not exactly sure about how to send
different data to each column.
At the moment the main column is being filled with data from a view file
using <%= @content_for_layout %>. How would I go about getting another
set of data from another view file into the other column?
Thanks
Henry
--
Posted via http://www.ruby-forum.com/.
2006 Mar 13
5
What is the matter with content_for_layout?
...caffold'', :media => ''all'' %>
<%= javascript_include_tag ''prototype'', ''effects'', ''rico_corner'',
''ajax_scaffold'' %>
</head>
<body>
<div id="container">
<%= @content_for_layout %>
</div>
</body>
</html>
After I start up the Webrick server,the html source will be as follows:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang...
2006 May 29
0
@content_for_layout transition effects
I was guessing if its possible to make transitions effects for the code
that are included inside @content_for_layout(ex: new, list, edit) like a
fade out and fade in, right now im using the accordion effect of moo.fx
but the content its to much inside and sometimes takes a while to load
and show the effect properly.
Any example or advice its more than welcome, ill keep searching about
this.
--
Posted via h...
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/.
2007 Sep 01
2
@content_for_layout or changing default fields on "new" page
...ve 0 or 1 in database. If I
created table with column BINARY, Rails would show me check box
instead of text field, but it is not the case (I have no BINARY data
type, and I do not know Rails has such possibility).
.
I tried to investigate how Rails automagically displays final web
page, and I find @content_for_layout. I think it is the variable
containing the data types the user wants to type in on "new" page. Is
it correct? Where can I find its definition and overwrite it? I agree
to write a lot of code :-)
.
I tried to read "Agile Rails...", but authors missed some explanations
and in the...
2006 May 23
11
adding layouts within layouts
Hi,
I want to be able to have several layouts within each other so that I don''t
have to keep repeating the layout code for one, in another. An example
would be having a layout for the title of your web page and then having an
embedded layout for the body portion in which the HTML for whatever view
gets displayed. Is this possible?
Thanks.
-------------- next part --------------
An
2006 Dec 17
1
Markaby template & layout (can't get them to work together)
...pplication.mab file. It didn''t get picked
up until after I restarted the webrick server. However, After I added
this code (from the markaby docs) it failed to render the controller
template.
Tweaking code showed that the index.mab template was still being
processes, but never assigned to @content_for_layout, which is nil.
html do
head do
title "hi" #action_name
stylesheet_link_tag ''scaffold''
end
body do
p flash[:notice], :style => "color: green"
self << @content_for_layout
end
end
Is there anything special I forgot to get these...
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
...lder example para"
end
end
I want to understand how to convert the scaffold generated layout:
<html>
<head>
<title>: <%= controller.action_name %></title>
<%= stylesheet_link_tag ''scaffold'' %>
</head>
<body>
<%= @content_for_layout %>
</body>
</html>
and template:
<h1>Editing accounts</h1>
<%= start_form_tag :action => ''update'', :id => @accounts %>
<%= render_partial "form" %>
<%= submit_tag "Edit" %>
<%= end_form_tag %>
&l...
2006 Jan 15
7
Include extra partial in layouts
Hi all,
Does anybody know how to include a partial (next to @content_for_layout) in a
layout file?
I''m looking for a something like @partial_for_include => ''filename'' in my
layout files. So a linked .rhtml file gets picked up from within a layout
file. All my layout files (4 at the moment) have a <div class="navright">
tag, so...
2006 Mar 31
3
Layout Question .. (Sitemesh related)
...ile that t1 gets decorated with):
<html>
<head></head>
<body>
<!-- can I use the variable show_menu here that might be defined in the
template this file is decorating -->
<div id=''menu''></div>
<div id=''main''>
<%=@content_for_layout%>
</div>
</body>
</html>
Is this possible in rails? If yes, how?
Thanks,
Mufaddal.
2006 Jan 04
4
HOWTO: Render partial in div
Hey-
I''m using ROR 1.0 and script.aculo.us 1.5.1. I''ve been trying
unsuccessfully to render a partial in a DIV, but can''t seem to get the
right combination of stuff to make it work. There seems to be a few
different ways of going about it. Right now I can render a partial.
What do I need to to render the partial in a div? Here is what it
looks like so far:
#
2006 Jun 22
4
stylesheet linking and layouts
In my layout, I have something like (shortened for clarity):
<html>
<head>
<%= stylesheet_link_tag "index", :media => "all" %>
</head>
<body>
<div id="site-container">
... <cut for space>
<%= @content_for_layout %>
... <cut for space>
</div>
</body>
A view action has another stylesheet defined in the opening line such as:
<%= stylesheet_link_tag "view_posts", :media => "all" %>
<div id="left-column">
blah, blah, blah
</div>
The layo...
2006 Mar 07
3
Can variables in the template be used in the layout?
...l
''related articles'' based on tags.
When a user clicks on an article to read, on that layout, I want a side
menu to have the related entries. If I develop the query to do this,
can I access the current tags for the entry in the layout?
I guess I''m asking, does <% content_for_layout %> keep the variables
within that? Or can they be accessed all throughout the page?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2007 Dec 08
6
Rails 2.0 ActionMailer breaks my redmine render_message
....rb
class Mailer < ActionMailer::Base
....
# Renders a message with the corresponding layout
def render_message(method_name, body)
layout = method_name.match(%r{text\.html\.(rhtml|rxml)}) ?
''layout.text.html.rhtml'' : ''layout.text.plain.rhtml''
body[:content_for_layout] = render(:file => method_name, :body =>
body)
ActionView::Base.new(File.join(template_root, ''mailer''), body,
self).render(:file => layout)
end
end
the last line is not accepted when running rails 2.0 => ERROR
ActionView::ActionViewError (Due to changes in Acti...
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, edit, list etc. My problem is that for each controller I want a
specific chunk of content to show up in the sidebar. How can I
accomplish...